[Resolved] WCML shows default currency, regardless of location.
This thread is resolved. Here is a description of the problem and solution.
Problem: WCML shows the default currency, regardless of location. Solution: If you're experiencing this issue, we recommend continuing to use WP Rocket instead of switching to Siteground Optimizer. Ensure that both the WPML and WCML plugins are active, as WP Rocket requires these to function correctly with WooCommerce Multilingual. For a detailed view, please check this specific line of code.
Please follow these steps: 1. Use FTP or File Manager to access your site's file system. 2. Navigate to /wp-contents/wp-rocket/inc/3rd-party/plugins/ecommerce and open "woocommerce-multilingual.php" in the editor. 3. Replace the code on Line 10:
4. Save the changes, clear both your site and browser's cache, and then test again.
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 further assistance is needed, please open a new support ticket at WPML support forum.
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.
I have contacted both WP Rocket and Siteground support and a friend who's an advanced developer. All have the exact same answer.
My friend developer helped pin point the issue. Here is her answer:
Clearly the the plugin is not compatible with SiteGround Dynamic Caching NOR with WP Rocket cache.
To confirm it's not compatible les's use WPML test page since it's simpler widget hidden link
1. Disable WP Rocket
2. Enable Siteground optimizer
3. Disable Dynamic cache hidden link hidden link
4. Clear Siteground Cache
5. Perform a check from Algeria from incognito. Then another from France from another browser incognito.
*** The currency works perfectly. ***
6. Enable Dynamic cache hidden link hidden link
7. Clear Siteground Cache
8. Perform a check from Algeria from incognito. Then another from France from another browser incognito.
*** The currency does not work anymore. In this test, the only caching mechanism used is Siteground Dynamic cache. ***
9. The next step is to exclude WPML's Cookies from caching. This can be performed via a filters hidden link
Here you can find the snippet: hidden link as you can see here:
*** Bypassing WPML cookies is not enough. Either support is missing something that should be bypassed or plugin is simply unusable.
By the way I also tested to do the the opposite by disabling Siteground Dynamic Cache (SG Optimizer must remain active) and enabling WP Rocket's cache. Also doesn't work. ***
----
@Prosenjit, I know you're trying to help but could you please either pass on this ticket to someone with more experience or ask your technical team?
Hi Nawfel,
Thank you so much for the detailed update.
I have escalated the issue to our 2nd tier team, with all the information you have shared for further investigation. As soon as I have any update from them, I will surely inform you.
Thank you so much for your patience and kind cooperation in this matter.
I've received some updates from the second-tier team and am sharing them below.
Since the issue was initially reported with the WP Rocket plugin, it is advisable to continue using WP Rocket rather than switching to Siteground Optimizer. Our team will also conduct further testing with WP Rocket as well.
WP Rocket supports compatibility with WooCommerce Multilingual, however, it is essential to keep the WPML Plugin active. The WP Rocket team has integrated constants for both WPML and WooCommerce Multilingual in their code; but, the function will work correctly only if both the WPML and WCML are active. For more detailed insights, please review hidden link">this specific line of code.
However, caching support for the standalone version of WooCommerce Multilingual (without the WPML plugin) seems to be not integrated yet.
Could you please try the following steps to see if they resolve the issue?
- Use FTP or File Manager to access your site's file system.
- Navigate to /wp-contents/wp-rocket/inc/3rd-party/plugins/ecommerce and open "woocommerce-multilingual.php" in the editor.
- Replace the code on Line 10:
If the solution worked, our development team will evaluate the best way to integrate it. If integration into WCML is possible, we will proceed with that approach. If not, we will reach out to the WP Rocket team and coordinate the necessary steps. So, please feel free to go ahead and apply the solution for now.
Additionally, since you have the Agency plan, you can activate the WPML plugin on your site. Please refer to the guide provided below, activate the WPML plugin, complete the setup, and you should be all set.
I'm glad to hear that the solution worked. Our development team will check further and decide whether to integrate it into our plugin or WP Rocket. I will keep you updated with any further information on this matter.