Hi Arturs,
Have you checked the underlying HTML code on whether they’re actually different? The reason I’m asking is that the differences could also be the result of font being used in those areas rather than the actual quotes.
If you can share a direct URL to that page, we’ll also be able to verify it from our side 🙂
Thanks!
Hello!
They ARE different, and because of that my translation plugin thinks that those are 2 different strings, so I have to translate all my titles twice.
I also tried to change font, but that didn’t help – those quotes are different.
Can you, please, help me fix this?
I can give you url in private content, but I don’t see here such option.
Good to hear from you again 🙂
At the moment, the forum support platform in WordPress.org does not allow for private details to be shared. In the event that the URL definitely not be shared in public, the next step would be to get in touch with a web developer with whom sensitive information can be shared separately to take a closer look
You can check that on your own site: https://themes.woocommerce.com/storefront/product/professional-chefs-kitchen-knife/
Add this product to cart, open cart widget, and there it is – 2 types of apostrophe.
Can you, please, fix this?
Can I get a reply, please?
Howdy Arturs,
Why are they different?
They are different because when the product title is output (and the same is true for the breadcrumbs) the WordPress function named the_title is called which then further processes the title through a function named wptexturize. The documentation on that function can be found here: https://developer.wordpress.org/reference/functions/wptexturize/
WooCommerce does provide some dynamically named filters that could be leveraged to force the product title to use typographer’s quotes when it is output in the cart/mini-cart/checkout page etc.
Here’s the filter that I would suggest using: https://github.com/woocommerce/woocommerce/blob/3.9.2/includes/abstracts/abstract-wc-data.php#L751
The hook prefix part of that filter name, in this case, would be woocommerce_product_get_ and since the property that we want to filter is name the full filter name would be woocommerce_product_get_name and it would pass the raw database value for the product title through the filter so one could hook into that filter with a callback function to run wptexturize against the value. Putting all of that together might look something like:
add_filter( 'woocommerce_product_get_name', 'wptexturize' );
It’s usually recommended that these types of snippets be placed in your theme’s functions.php file, but I personally don’t think that’s a good idea since depending on how the theme update works you may lose these custom changes when updating your theme. Some people use the [Functionality](https://wordpress.org/plugins/functionality/) plugin or something similar for this purpose.
Hello!
Yes, yes, yes, now all the quotes are in the same style, which is just what I wanted.
Thank you very, very much!