• Resolved garrettm30

    (@garrettm30)


    In many places throughout the frontend, product titles are filtered with the_title, but I would like to report that I have found a couple places where they are not. To summarize: 1) products in a grouped product, 2) the cart.

    First are products that are part of a grouped product. Looking at the sample link I provided, notice the titles of the four products that make up the grouped product. The apostrophes in the titles are straight, whereas they should be the proper typographical apostrophe. Less obvious is that the space in front of the question mark is a no-break space (U+00A0,  ) when it should be a narrow non-break space (U+202F). For comparison, the main title does show that it has been filtered, as it shows these two traits.

    This occurs not only on the grouped product page, but also in the cart. If you wish, add one of the products to the cart. In the added to the cart message, notice that the product title has been filtered. On my dev copy of the site, I have confirmed that it is the_title on the product name rather than the_content on the entire string.

    The second place is in the cart (in French: panier) itself. The item titles in the cart are not filtered.

    My site has quite a bit of customizations, but on my dev copy, I did test by disabling every plugin except WooCommerce to confirm that the behavior I have described above still manifests.

    Although this is submitted as feedback rather than as a request for support, I can privately provide my WooCommerce status report if it is helpful for reproducing.

    Thank you for all you do. WooCommerce is a vital part of our website.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Saif

    (@babylon1999)

    Hello @garrettm30,

    In many places throughout the frontend, product titles are filtered with the_title, but I would like to report that I have found a couple places where they are not. To summarize: 1) products in a grouped product, 2) the cart.

    First, I assume you mean the products are filtered alphabetically. Indeed, in the cart the products are not filtered in alphabetical order.

    To fix this, you can add the following snippet to your site.

    You can add it to your functions.php file or use a plugin like Code snippet.

    First are products that are part of a grouped product. Looking at the sample link I provided, notice the titles of the four products that make up the grouped product. The apostrophes in the titles are straight, whereas they should be the proper typographical apostrophe.

    I was able to reproduce this on my test site as well, an easy fix is to use a typographical apostrophe in product titles instead of relying on WooCommerce to change it.

    The shortcut for it on macOS is option+shift+].

    As you’ve mentioned, these are enhancements, they are better taken to GitHub directly.

    You can make an issue report from here, they are not limited to just bugs. You can make suggestions as well.

    Hope this helps!

    Thread Starter garrettm30

    (@garrettm30)

    First, I assume you mean the products are filtered alphabetically.

    No, it has nothing to do with sorting alphabetically, but I do appreciate your kindness in replying with a solution to the need you thought I had. What I am talking about is applying the WordPress filter the_title to the product titles. Default WordPress uses this hook to do things like change straight quotes to typographical quotes and apostrophes, and the filter is also available for other uses, such as in our case we apply the appropriate narrow no-break spaces according to French punctuation.

    In most cases, WooCommerce does apply the filter to product names for frontend display, but not in these two cases I have mentioned.

    Changing the product titles themselves is a partial workaround, but it is not ideal because it breaks searches in default WordPress. A user types L’Eglise on a standard keyboard and a product titled L’Eglise will not match. (Fortunately, we use Relevanssi Pro for improved searches, so we do not have this issue.)

    I thank you for the link to Github. I misunderstood about where to post requests for improvement. I will take the issue there and consider it resolved here.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Product names are not filtered with the_title’ is closed to new replies.