[Resolved] When changing currency on product, it does not change
This thread is resolved. Here is a description of the problem and solution.
Problem: The client reported that when they are on a product page and change the currency, the currency does not update unless they navigate to a different product or category page. Solution: We suggested a workaround involving either WP Rocket settings or a code snippet: 1. Navigate to Settings > WP Rocket. 2. Go to Advanced rules > Never Cache Cookies. 3. Add the cookie
wcml_client_currency
. Alternatively: 1. Empty your cache first. 2. Open your theme's functions.php file. 3. Insert the following code:
/*<br />compsupp-7372<br />This filter adds ?wcmlc={currency_code} to the URL, which specifies a query string with the currency code.<br />*/<br />add_filter('wcml_is_cache_enabled_for_switching_currency', '__return_true');
The client only needs to try one of these solutions, not both.
If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.
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.
When I'm on a product and I've changed currency, the currency on the product does not change. I need to update o a diffetent product or category for the currency to change.. How can we fix this?
hi, I tired to disable both Object Cache, and also Fibosearch but it did not help.. I still need to change URL (product or page) for the currency to change on the product. Is that normal? I need the currency to change on the same page..
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.
I encountered an issue with the SFTP connection. When attempting to use the Duplicator plugin to create a copy for testing in a minimal environment, it caused a redirect loop, requiring manual deactivation.
Please navigate to your file manager, go to wp-content/plugins/duplicator, and add .deactivate to the folder name? This will remove the plugin.
It is quite clear now that the currency swicher does not work wit hDivi when we use the Divi builder on the product or product pages.
How can we solve this?
I am testing this based on your findings with the divi builder being used on the product and will update you.
Do I have your permission to add a new test product to test this on your site, as I have not been able to reproduce on a local environment.
Also, if possible I would like to install the plugin cloudways migration to take a copy of your site and move onto our staging environment where we both will have access to showcase any of our findings.
Hi, yes you can add a new test product, don't give it any SKU please. And please use this as we have a connection with an API, and I need to test it on a "live" site actually.
After doing some additional tests, the issue persists whether it's a product created with the Divi Builder or a simple WordPress product.
I also tested this on a clean sandbox with Divi and could not reproduce it.
Interestingly, when logged in as an admin or user, the issue doesn't occur until after a page refresh. However, the problem persists without requiring a refresh when viewing the same product in an incognito window.
I understand that disabling caching might not be feasible, but would you consider temporarily deactivating it for a quick test? Based on all tests so far this points to a caching-related behavior.
This would help us verify if caching is indeed the cause of this behavior. If so, we can escalate it to our second-tier support for further investigation.