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 wait time is higher than usual, please make sure you are meeting the minimum requirement - https://wpml.org/home/minimum-requirements before you report issues, and if you can take a look at current Known Issues - https://wpml.org/known-issues/. Thank you.
Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Los_Angeles (GMT-07:00)

This topic contains 10 replies, has 1 voice.

Last updated by Bobby 3 days, 18 hours ago.

Assisted by: Bobby.

Author Posts
March 13, 2025 at 10:44 pm #16813926

tobiasH-57

Background of the issue:
I implemented the Currency Switcher in the footer using a shortcode. I excluded the following cookies from Litespeed Caching: wcml_client_currency
wcml_client_country
wcml_client_currency_language
wcml_client_currency_switched

And I deleted the USD currency from the WooPayment native MultiCurrency selection to avoid confusion. Link to a page where the issue can be seen: hidden link

Symptoms:
When I switch the currency, the page reloads, but it still shows the old currency. The currency only changes when I navigate to another page. Additionally, the price is rounded incorrectly, showing 6,95 USD instead of 6,40 USD, despite having 'Rounding to the nearest integer' disabled and 'Autosubtract amount' set to 0.

Questions:
Why does the currency not switch immediately after reloading the page?
Why is the price rounding incorrectly despite the settings?

March 14, 2025 at 9:45 am #16815564

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Do you have Multi-Currency enabled in WooPayments?

If so, please disable this feature and test again.

Best regards
Andreas

March 15, 2025 at 1:33 pm #16819894

tobiasH-57

Hi Andreas,
I deactivated WooPayments MultiCurrency Feature now and cleared all browser and server caches.
The problems still persists.

Best regards
Tobias

March 17, 2025 at 6:44 pm #16826925

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

When I visit your site I cannot see the currency switcher anymore.

Did you temporarily deactivate it? My only option is EUR.

I also tested adding it to the cart and trying to checkout using a US address but it still remained in EUR.

March 18, 2025 at 11:37 am #16829837

tobiasH-57

Hi,

for testing purposes I only have the currency switcher in the footer of the German version at the moment. So if you switch to German (or just remove /en in the URL) and scroll all the way down, you should be able to see and test it.

Best regards
Tobias

March 18, 2025 at 6:15 pm #16832051

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you, i missed that! 🙂

I was able to reproduce the issue and also catch it on screencast, here is the screencast for our records.

hidden link

The first time I tried it worked fine and switched from EUR to USD, the second time it did not until I went to another page and then it was in USD.

This does look possibly related to caching.

1. What are your results if you temporarily deactivate caching then test in an incognito mode ?

We have seen issues like this caused by Litespeed caching before.
I understand you have excluded the cookies but I wonder if it's still causing an issue.

2. Go to WPML->languages-> Language filtering for AJAX operations and enable Ajax

March 21, 2025 at 10:06 am #16843591

tobiasH-57

Hello,
Thanks for your reply.

The problem with the switcher, not changing the currencies every time, is indeed related to Caching. When I deactivated the Litespeed Plugin it was switching as it should. So I guess there’s something else I need to exclude from Caching?

Language filtering for AJAX was already activated.

But the weird rounding of USD prices doesn’t seem to be connected to Caching. It didn’t change when Litespeed was deactivated.

Best regards
Tobias

March 21, 2025 at 6:05 pm #16846148

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

I can see that you have added the following cookies to your cache exclusion list:
wcml_client_country
wcml_client_currency_language
wcml_client_currency_switched

please add this one as well:

wcml_client_currency

If this does not resolve the issue, consider also adding WooCommerce pages to the exclusion list.

Regarding the rounding, I will need to further review as it might not be related to this issue. Once we finish the caching issue I can take a further look and investigate separately

Let me know your results, after doing the above.

March 23, 2025 at 8:02 pm #16849244

tobiasH-57

Hi,
Excluding wcml_client_currency from caching didn't help.
I don't think excluding woocommerce pages entirely from caching should be the solution. That would be a big set-back for page speed.

March 24, 2025 at 7:52 pm #16853897

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Is this something you could possibly test so we can confirm if this is indeed the issue here?

If you don't have a staging site where this can be tested or don't feel comfortable testing on the live site, we can migrate a copy of the site onto our servers to continue testing.

March 28, 2025 at 11:57 am #16872673

tobiasH-57

Hi,
I set up a staging site now, that I can give you access to. Please let me know, how to send you the user credentials.

In the meanwhile I tried setting the wcml_client_currency in Advanced > Vary Cookie, instead of Exclude Cookie. But that didn't help either.

Now I also tried excluding all ^/shop/ pages, while leaving Caching activated on all other pages. That does indeed fix the problem. But of course it's important for me to keep those pages cached normally.

March 28, 2025 at 10:46 pm #16874696

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby

April 1, 2025 at 1:47 am #16881193

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you for the access details!

On the staging site I have not been able to reproduce the issue, can you please try and let me know your results.

Also on the live site try the following and let me know your results as well.

add_filter( 'wcml_multicurrency_supported_cache_plugins', function( $plugins ) {
$plugins[] = 'LiteSpeed Cache';
return $plugins;
} );

NOTE: before trying any custom work provided by us or somebody else please make sure to have a working backup available.

April 1, 2025 at 1:48 am #16881196

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you for the access details!

On the staging site I have not been able to reproduce the issue, can you please try and let me know your results.

Also on the live site try the following and let me know your results as well.

add_filter( 'wcml_multicurrency_supported_cache_plugins', function( $plugins ) {
$plugins[] = 'LiteSpeed Cache';
return $plugins;
} );

NOTE: before trying any custom work provided by us or somebody else please make sure to have a working backup available.

April 1, 2025 at 4:38 pm #16883958

tobiasH-57

Hi.
You couldn't reproduce it, because /shop was still in the list of urls excluded from Caching. I removed it again, so that you can reproduce it now.

I inserted your suggested code as a snippet in functions.php. After reloading in a private browser window nothing changed.