Skip Navigation

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:

function rocket_wcml_has_requirements() {<br />return defined( 'ICL_SITEPRESS_VERSION' )<br />&& version_compare( ICL_SITEPRESS_VERSION, '4.4.11', '>=' )<br />&& defined( 'WCML_VERSION' )<br />&& version_compare( WCML_VERSION, '4.12.6', '>=' );<br />}

With:

function rocket_wcml_has_requirements() {<br />return defined( 'WCML_VERSION' )<br />&& version_compare( WCML_VERSION, '4.12.6', '>=' );<br />}

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.

This topic contains 21 replies, has 2 voices.

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

Assisted by: Prosenjit Barman.

Author Posts
April 24, 2024 at 8:53 am

mohamed-nawfelO

WCML shows default currency, regardless of location....

April 24, 2024 at 9:53 am
April 25, 2024 at 11:39 am #15565284

Prosenjit Barman
Supporter

Languages: English (English )

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

Hi There,
I hope you're doing well.

From the discussion you had with my colleague Waqas, I understand that the default currency (DA) consistently appears, even when the site is accessed from outside Algeria. I observed the same behavior when I logged into your site. However, when I accessed your site using the browser's incognito mode, the currency displayed was Euros, not the Algerian Dinar. Here’s a screenshot for your reference: hidden link [Site was accessed from France].

Since everything appears to be functioning correctly, it's possible that a purchase was previously made using the account you are logged in with, and the default location for this account has been saved as Algeria in the WooCommerce database. This could explain why the Algerian Dinar continues to appear when you're logged in and accessing the site from a different location.

Could you please check again using your browser's incognito mode, and ensure that you are not logged in?

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

Best regards,
Prosenjit

April 25, 2024 at 12:24 pm #15565509

mohamed-nawfelO

Hello Prosenjit,

Thanks for your message.

I believe the issue was not correctly reported by Waqas. I mean that was an issue that Waaqas encountered on his own but that's not the issue I reported.

My issue was initiially with WP Rocket / WPML. But then Waqas mentioned it doesn't have to do with WP Rocket.

I'm not sure Waqas performed his test from an incognito but I can ensure you that WP Rocket support team and myself tested from multiple devices and networks in incognito mode before contacting you.

To clarify, the issue is: when WP Rocket is active, the currency sign doesn't work well (especially on home page). I reported to WP Rocket first. After investigation, they said the issue is with WPML

I believe it's best if you go back to my initial problem. You can find my email exchange with the WP Rocket at the beginning of the chat.

I've also shared access to my site, feel free to activate WP rocket and test. I've just tested on my own (incognito + multiple device) and the issue reains.

Best,
Nawfel

April 26, 2024 at 5:12 am #15567745

Prosenjit Barman
Supporter

Languages: English (English )

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

Hello Nawfel,
Thank you so much for clarifying the issue one more time.

For some reason, the conversation you had with Waqas isn't loading for me, which is why I couldn't fully understand the issue. Waqas has added a summary of the conversation, and I responded based on that information.

I logged into your site and confirmed that WP Rocket is active and the products are indeed displayed in Algerian Dinar on the homepage. However, when I accessed the site from an incognito window, the Euro currency still appeared correctly on the Homepage since I am accessing from outside Algeria.

The prices are displayed in Algerian Dinar, even from a location outside Algeria because the billing address saved is in Algeria. Removing this address switches the display back to Euros. I have recorded a video during my testing, which you can view here: hidden link

During my investigation, I did not observe any issues with the currency when accessing the site from various geolocations as a guest user. The currency is displayed correctly for countries outside Algeria.

However, if there's a different issue than what I've understood, could you please share some screenshots or a video related to the problem? Since the conversation isn't loading for me, I might be missing some details that a screenshot or video could help clarify.

I hope you can understand, and I sincerely apologize for any inconvenience this may have caused. I will do my best to assist you in resolving the issue.

Best regards,
Prosenjit

April 28, 2024 at 4:01 pm #15574155

mohamed-nawfelO

Hello Prosenjit,

Thanks for taking the time.

Unfortunately, the issue is different from what you described. Also your video is unaccessible.

Here's a full test to see the issue: hidden link

PROCESS:

1. Activate WP Rocket
2. Clear cache WP Rocket
3. Activate VPN from USA
4. Visit website from Chrome incognito window

Prices are in EURO (all good. No problems until here)

5. Disabled VPN, I'm based in Algeria
6. Visit website from Safari incognito window

Problem: the currency is in EURO when it should be in DA.

THEN I DID THE PROCESS BACKWARD TO CONFIRM THE PROBLEM EXISTS:

1. Activate WP Rocket
2. Clear cache WP Rocket
3. Make sure there is no VPN, I am in Algeria
4. Visit website from Chrome incognito window

Prices are in DA (all good. No problems until here)

5. Activate VPN from USA
6. Visit website from Safari incognito window

Problem: Prices are in DA when it should be EURO

WAQAS WAS RIGHT !

Your colleague Waqas tested the the same process without WP Rocket nor Siteground. He still got the same results. This is why he concluded that it was solely a WPML issue - same as WP Rocket concluded.

I took the time to do the same test and he was right!

Best,
Nawfel

April 29, 2024 at 7:13 am #15574948

Prosenjit Barman
Supporter

Languages: English (English )

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

Hello Nawfel,
Thank you once again for the detailed update. It really helps to understand the issue more.

I have checked exactly as you did and the Euro currency appeared correctly. However, since I don't have access to the Algerian VPN, I couldn't test from that country. If you want, please request access for the video and I will grant it so that you can understand my test procedure.

Since you suspect that the issue may be between WooCommerce Multilingual and WP Rocket, could you please add the following cookies to the cache exclusion list under the Advanced Rules of WP Rocket and check if that helps to solve the issue?

wcml_client_currency
_wcml_booking_currency
wcml_client_country
wcml_client_currency_language
wcml_client_currency_switched

Please be aware that it might take some time for these changes to take effect. Once added, clear the WPRocket caches accordingly and check again.

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

Best regards,
Prosenjit

April 29, 2024 at 7:48 am #15575185

mohamed-nawfelO

Hello Prosenjit,

I think you missed the last part of my former text:

WAQAS WAS RIGHT !

Your colleague Waqas tested the the same process without WP Rocket nor Siteground. He still got the same results. This is why he concluded that it was solely a WPML issue - same as WP Rocket concluded.

I took the time to do the same test and he was right.

I am getting currency issues even though all cache is disabled on the website.

Best,
Nawfel

April 29, 2024 at 8:15 am #15575377

mohamed-nawfelO

I have made a video where you clearly see that even if WP Rocket and siteground cache are disabled then you get the same problem.

I also added US$ for USA only as a currency. Testing a few time will triger the issue. hidden link

I am getting the same consistent results that WP ROcket support and your colleague waqas have had.

If you don't have access to a VPN, then could you please pass on this ticket to another support agent?

Best
Nawfel

April 29, 2024 at 8:26 am #15575463

mohamed-nawfelO

(Just to let you know that I also tried to activate WP Rocket and add cookie exclusions as per your advice, it just doesn't work)

April 30, 2024 at 4:47 am #15579202

Prosenjit Barman
Supporter

Languages: English (English )

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

Hi Nawfel,
Thank you for all the information.

I installed a VPN client with access to an Algerian server and followed your testing instructions. I observed the issue you described.

For further testing, I created a page with a WooCommerce product block. On this page, I noticed that the price and currency are being dynamically updated based on the user's location. You can check this behavior yourself by visiting: hidden link

Upon reviewing the product listing template you created for the homepage's product section (Jetengine > Listings > Product loop), I noticed that the price is inserted using Jetengine's Archive Price widget. This widget could be contributing to the issue with the currency updates.

Could you please replace this widget with Elementor's default Product Price widget (hidden link) and see if the problem persists?

Also, ensure you clear all caches thoroughly. When you reopen the page in an incognito window, check the price section and confirm that Elementor's Price widget is being used, not Jetengine's.

Additionally, if there is server-level caching enabled on your site, please clear those caches as well before conducting the test.

Please let me know how it goes. I'll be happy to help if you need further assistance in this matter.

Once again, thank you so much for your kind cooperation!

Best regards,
Prosenjit

May 7, 2024 at 12:12 pm #15601773

mohamed-nawfelO

Hello Prosenjit,
Thanks for your message. I was a way for a week. Will test and get back to you shortly.

May 7, 2024 at 1:51 pm #15602502

mohamed-nawfelO

Hello Prosenjit,

I think you are mistaken in the steps you followed to test the issue.

It appears your plugin is not compatible with any cache plugin. Can you confirm that it is supposed to work with WP Rocket? knowing that I already excluded the coockies as you requested.

Best,
Nawfel

May 8, 2024 at 6:14 am #15604256

Prosenjit Barman
Supporter

Languages: English (English )

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

Hi Nawfel,
I hope you're doing well.

Thank you for your feedback on the testing process. I carefully followed the instructions you provided in your previous messages and was able to identify the issue according to those guidelines. Specifically, I observed discrepancies in pricing when I changed locations. Initially, I was unable to trace the issue because I didn't have access to a VPN that supports an Algerian location. However, after obtaining the appropriate VPN, I conducted the test and successfully traced the issue.

Regarding the compatibility with the Caching plugin - Please note that our plugin is designed for compatibility with most caching plugins, including WP Rocket. We have integrated a caching mechanism within the WooCommerce Multilingual plugin to ensure seamless operation in most caching environments. For more details on WPRocket compatibility, you can check this link: https://wpml.org/plugin/wp-rocket/

However, based on the investigation, the problem seems to be specific to Jetengine's "Archive Price" widget. As I mentioned previously, have you tried replacing this widget with Elementor's default Product Price widget (hidden link) to see if the issue continues? Additionally, please consider removing the cookies from the exclusion list before running your tests.

Please let me know the update. If you need further assistance, we will be happy to help.

Best regards,
Prosenjit

May 8, 2024 at 9:54 am #15605296

mohamed-nawfelO

Hello Prosenjit,

Thanks for your message and taking the time resolving this.

You did trace the issue but I don't think you proceeded with the full test with this page hidden link because, as mentioned previously, I have tested with hidden link and it doesn't work. If the issue was with the template, the page you created would work.

I also tested with Elementor's default Product Price widget as per your suggestion before replying and it still does not work. (The widget you proposed is currently in use on the website)

The WP Rocket team mentioned in their reply that it's a cache issue and that the plugin is not compatible with caching (neither WP Rocket nor Siteground's Dynamic cache). I believe this is why you are not listed on their website hidden link

Could you please help resolve this once and for all? My website is online and we're taking a hit sales wise because of this issue.

Best,
Nawfel