Support » Plugin: WooCommerce » HTML characters problem in featured products block

  • Resolved tmnewslang

    (@tmnewslang)


    Hello,

    On one of my client’s website, we had a problem with certain special characters in product’s titles. WordPress was converting “-” to “–” and “‘” to “’” for example.

    This lead to other problems, but one of them was that when trying to add a featured product block, when searching products, the titles would show HTML codes instead of special characters and search wasn’t working properly.

    Here’s an example : https://www.screencast.com/t/WQsjRuqttG7H

    After finding out the bug inside the plugin, I went back and replaced characters manually in the database, so there is no more occurence of HTML codes inside product’s titles.

    My problem is this : since special chars have been corrected in the database, why does it still show inside this block ? Is WooCommerce creating an index of products, should I need to update this index to solve this issue ?

    Thanks for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Mashi

    (@shaonback2)

    Hello @tmnewslang!

    On my test site, I created a featured product that has “-” within the title and couldn’t reproduce the issue that you faced.
    Also, when I added the featured product block on a page it worked smoothly.

    I believe the issue you are facing is caused either by a conflict with your theme or with another plugin.

    The best way to determine this is to:

    • Temporarily switch your theme to Storefront
    • Disable all plugins except for WooCommerce
    • Repeat the action that is causing the problem<

    If you’re not seeing the same problem after completing the conflict test, then you know the problem was with the plugins and/or theme you deactivated. To figure out which plugin is causing the problem, reactivate your other plugins one by one, testing after each until you find the one causing conflict. You can find a more detailed explanation of how to do a conflict test here. → https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    Before you start

    First, please make sure you have a good backup in place of your full site and database. Most hosting companies have this included in the subscription, but you could also consider using a service like Jetpack. If something goes wrong, it’s nice to know that you can restore your site.
    Second, I would suggest installing a plugin called Health Check & Troubleshooting. This is a plugin developed by the WordPress community and it allows you to disable plugins without affecting your current site visitors.

    Let us know how it goes.

    Thread Starter tmnewslang

    (@tmnewslang)

    Hello Mashi,

    Thanks for getting back to me.
    I have a development copy of the website, I’ll try this in a few days. But I’m pretty sure it’s not just a problem of a “-” character.

    The problem is : I edited the DB manually to remove problematic characters, this never triggered WordPress to update any product. I believe WooCommerce is keeping a separate index of the products for the purpose of search in the back office, and I suppose this index has not yet been updated.

    Thus, all the products with faulty characters, even though they’re good in the database, are not good in the search. I checked to see if any product title was saved in a lookup database (used by WC for performances) but it doesn’t seem to be the case.

    I try manually updating a product by clicking save on it after changing it’s title in the DB, it didn’t correct the search.

    I’ll do the whole test, deactivating plugins + themes and I’ll let you know, thanks.

    Plugin Support Margaret S. woo-hc

    (@margaretwporg)

    Hi @tmnewslang

    Thanks for sharing your findings.

    Please complete the test and let us know if a conflicting plugin (or the theme) could be found.

    We’ll be happy to check further.

    Thanks

    Plugin Support Margaret S. woo-hc

    (@margaretwporg)

    We haven’t heard back from you in a while, so I’m marking this thread closed for now – we’ll be here if and/or when you are ready to continue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘HTML characters problem in featured products block’ is closed to new replies.