Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Our next available supporter will start replying to tickets in about 2.06 hours from now. Thank you for your understanding.

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by Prosenjit Barman 5 months, 2 weeks ago.

Assisted by: Prosenjit Barman.

Author Posts
November 3, 2023 at 10:09 am #14724331

Giulio

Good morning, we are experiencing an issue with WPML's multi-currency feature.

In our case, the default currency is always the euro, regardless of the country you connect from. The dollar is set as the secondary currency, while other currencies are set based on geolocation because they are only available for specific countries.

The problem lies in the fact that Google has started to display products in dollars in search results, with all the imaginable consequences. Why is this happening?

I repeat, the default currency is the euro. So even if you connect from the United States, since the euro is the default currency, it is shown first theoretically. To switch to the dollar, you need to click on the widget.

Why does this happen? What are we doing wrong?

Thank you.

Screenshot 2023-11-03 alle 10.55.07.jpg
November 3, 2023 at 11:50 am #14725511

Giulio

We are trying to inhibit the normal functioning of WPML when the user agent is that of Google. Have you by any chance come up with any snippets that can achieve this? This would actually solve the issue.

November 6, 2023 at 8:25 am #14735365

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support. Sorry for the delay in responding due to the weekend.

I understand the issue you're having and will try my best to assist you in this matter.

Rather than directly visiting your site, I changed my location to the USA and then looked up one of your products on Google. Upon opening the product, I observed that the default currency, the Euro, displayed correctly alongside the product. The USD currency only became visible when I switched to it.

Please check this video I made during testing: hidden link

Since the default currency was showing fine during my investigation, it appears that the configuration for multicurrency is correct on your site. May I know which product specifically was showing the USD currency? If there are any specific steps to see the issue, please let me know that too. I will check and guide you accordingly.

Additionally, it's important to note that the way a product or post is indexed is determined entirely by Google's Crawler bot. According to the WPML Debug information, the Yoast SEO plugin is activated alongside WPML SEO, which is correct. If the SEO settings are correctly configured, the Crawler bot should index and display content on the search engine in accordance with those configurations. The WPML plugin doesn't have any control over the crawler. I hope you can understand.

Let me know the update. I will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

November 7, 2023 at 10:24 am #14745865

Giulio

Dear Prosenjit,

If you notice, during your video test, in the top right corner, there is a dollar sign as the selected currency. This is because you are connecting from New York. So, in fact, WPML (with MaxMind) is working! The site detects your location and displays the currency assigned to the United States.

The issue is that, with Litespeed and the cache with a CDN in place, the product prices and the page itself are served from the cache. This includes the menu, which is also cached.

At this point, what I would like to ask is whether WPML has devised a way for multi-currency to work with an active cache and CDN.

Of course, we don't rule out any options, but we would like to understand how to work around the issue so that your plugin can perform at its best with Litespeed.

Thank you very much.

November 7, 2023 at 12:15 pm #14746869

Giulio

To work around the issue, we would like WPML not to automatically update prices (MaxMind). You might wonder why this madness. We are thinking of updating prices through the use of Ajax calls, so that the cache only contains pages with the default currency.

Is it possible to prevent WPML from acting automatically, but only upon an actual click on the multi-currency selector?

November 8, 2023 at 5:01 am #14752665

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thank you for your detailed explanation.

If you have set up 'Currency per Location', then WCML will automatically show prices in the currency relevant to the user's location. This is an automated process, and without bespoke programming, there's no way to stop prices from updating automatically based on the user's location.

If you choose to implement custom coding, you can refer to the hook guide for WCML provided below.

- https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/

Since you're using a caching plugin, it's likely that the currency cookie is being cached and served to users, which could lead to them seeing incorrect prices. In such cases, we recommend excluding pages from the cache that use browser cookies and multi-currency. Rest assured that we are working with popular caching plugins to improve compatibility.

Please try the following steps and I hope it will help to solve the issue.

1) From your WordPress Dashboard, navigate to the "LiteSpeed Cache » Cache » Excludes" tab
2) In the “Do Not Cache URIs” field, add the slugs of the WooCommerce pages. If you've set a Base URL for Product in "Settings > Permalinks", make sure to add that in the exclusion list as well.
- In the “Do Not Cache Cookies” field, add the following cookies(one per line)
-- wcml_client_currency
-- wcml_client_currency_language
-- wcml_client_country
3) After saving your changes, make sure to clear the cache. If your CDN offers the option to exclude specific pages and cookies, please apply those exclusions in the same manner.

The changes can take some time to propagate. It would be better if you could check again after a few hours.

Let me know if that helps or if you need further assistance in this matter. I will be happy to help.

Best regards,
Prosenjit

November 8, 2023 at 5:26 pm #14759947

Giulio

Dear Prosenjit,

I apologize if I have to say this, but I'm not sure what world the WPML support team lives in. As an E-Commerce manager, I don't know of any professionally built website that doesn't utilize caching to serve pages quickly. That's why I truly don't understand how you can suggest NOT using cache on product pages. It's a really bewildering recommendation...

When we reach out to you, it's because we hope that you, who have built this plugin and thoroughly tested it, have the necessary expertise to use it to its full potential in professional conditions. Where "professional" means with the use of caching. Not without it.

Thanks.

November 9, 2023 at 8:35 am #14763137

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,

I appreciate your feedback and totally understand the importance of caching in delivering a fast and efficient user experience, especially in the context of professionally built websites.

However, our advice to disable caching on product pages is specifically applicable when the multicurrency feature is active in a cache-enabled environment. If you've configured Currency Per location, the cookies that store Geolocation and Currency information can be saved in the cache. This can lead to incorrect pricing being displayed to the user due to the cached data being served.

I understand that excluding pages from being cached is not an ideal solution and we are actively working on improving this aspect of our plugin.

However, in most cases, this kind of issue also gets resolved by excluding the cookies from being cached. Could you please try excluding the cookies from the cache, as I suggested in my previous message? Doing so should solve the issue and it won't affect the page loading speed or the website's performance. Here is the list of cookies that you can exclude from being cached.

-- wcml_client_currency
-- wcml_client_currency_language
-- wcml_client_country

I would appreciate it if you could try this approach and let me know the results. If you need further assistance in this matter, I'm here to help.

Best Regards,
Prosenjit

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.