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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 -

Supporter timezone: Europe/Paris (GMT+02:00)

This topic contains 30 replies, has 2 voices.

Last updated by Yvette 4 years, 9 months ago.

Assisted by: Yvette.

Author Posts
August 18, 2020 at 10:04 am #6821823

carlos-helderG

Checkout does show the currency correctly (direct link to check yourself here: hidden link ).

But the currency on the store shows a wrong currency (direct link to check yourself here: hidden link ). The currency should be USD ($) because I’ve set the proxy in United States. However, the price is shown in British Pounds instead.

This is the shortcode used on that page: [product_category category="2"]

Any idea to show the correct currency everywhere? 🙂

Thanks

Carlos

checkout - correct currency.png
woocommerce store - wrong currency.jpeg
August 18, 2020 at 6:43 pm #6825763

carlos-helderG

I see this thread is not [Assigned] yet. So I wonder if I must answer my own message to "fix" it 🙂

August 20, 2020 at 9:02 am #6836823

Yvette
Supporter

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

Timezone: Europe/Paris (GMT+02:00)

Hello

I´ll be helping you now.

For me, located in Spain, the currencies are the same. They both show Euro prices.

From what you wrote, I undrestand that you want your shop to always show prices in USD but the checkout to show local currency prices based on their language. Is that correct?

Our currency switcher is working based on active session language and not on any kind of geolocation logic. So I´m not sure how you will be able to get what you describe to work.

August 20, 2020 at 10:33 am #6837497

carlos-helderG

Sorry, but you're wrong: It is possible to change the currency based on the customer location in version 4.10.x of Woocommerce Multilingual plugin. You can read more about that here:
https://wpml.org/announcements/2020/08/wcml-4-10-currencies-and-payment-options-based-on-location/

I want that:
- If the user is located in UK, the prices are shown in British Pounds
- If the user is located in US, the prices are shown in US Dollars
- If the user is located in ES, the prices are shown in EUR

Currently, checkout does show the currency correctly (direct link to check yourself here: hidden link ).

Unfortunately the currency on the store shows a wrong currency (direct link to check yourself here: hidden link ). The currency should be USD ($) because I’ve set the proxy in United States. However, the price is shown in British Pounds instead.

This is the shortcode used on that page: [product_category category="2"]

Please, see the screenshots I've attached on the first message.

Any idea to show the correct currency everywhere? 🙂

Thanks!

Carlos

August 20, 2020 at 10:56 am #6837711

Yvette
Supporter

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

Timezone: Europe/Paris (GMT+02:00)

Excuse me - you are right as I forgot about the new feature and I have not had time to understand it fully.

From what I´ve been told by development team, the new feature is supposed to work as follows:
1. For logged user we’re using the billing country
2. For not logged we’re using the country by IP or billing country if you’re on the checkout page

Is this not what you are experiencing?

If that is the case, I will ask you to recreate this scenario on a sandbox site that I will prep for you so I can report the bug.

Please let me know

August 20, 2020 at 12:39 pm #6838617

carlos-helderG

You mean that the geolocation feature only works in the checkout page? I don't think so... It doesn't have much sense for me to show the prices on the wrong currency or mixing currencies on the same store...

What happens is that different currencies are shown depending of the page. For example, on US (using a proxy to test it):
- Checkout is showing US dollars (perfect!)
- The store is showing British pounds (wrong!)

I've included screenshots on the first message for better understanding as well as links to check yourself along this thread.

Thanksss

Carlos

August 21, 2020 at 7:44 am #6843475

Yvette
Supporter

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

Timezone: Europe/Paris (GMT+02:00)

Hello Carlos,

The images did not upload - could you please try again so I can forward your comments to development for clarification?

Make sure your images are less than 1M to load to the forum.

Could you also explain how you implemented the "proxy" you are referring to? I will try to setup the same store in the sandbox site.

Thanks again for your collaboration.

August 21, 2020 at 8:47 am #6844179

carlos-helderG

The images uploaded perfectly because I'm seeing them. They are on the first message (message of AUGUST 18, 2020 AT 10:04 AM).

The proxy I've used for testing is a Firefox addon: hidden link

Screen Shot 2020-08-21 at 10.42.33.png
August 21, 2020 at 11:16 am #6844965

Yvette
Supporter

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

Timezone: Europe/Paris (GMT+02:00)

You are right (again). I´ve forwarded your comments/questions to the 2nd tier supporter that knows more about this new feature. Please be patient while I wait for a response.

August 21, 2020 at 12:00 pm #6845205

carlos-helderG

Warning: that page is not working well after changing the default language: https://wpml.org/forums/topic/after-changing-default-language-lang-menu-and-woocommerce-shortcode-disappeared/

August 23, 2020 at 2:30 pm #6854505

carlos-helderG

UPDATE

I think I've found why that page has disappeared. I'm updating the issue with new information that should help you guys to find the bug. With a proxy in US:

  • This page shows the prices in $ (so it's working correctly): hidden link
  • This page shows the prices in British pounds (so it's NOT working well): hidden link
  • Extra: the function: get_woocommerce_currency() shows the prices in British pounds (so it's NOT working well). I'm using that function to show the prices here: hidden link
  • _
    WAIT: after maybe 10 minutes, the 3 are showing the price in USD dollars but wrongly! haha I mean, I've configured them to "Set prices in other currencies manually" (but those prices are not been shown)

    Then I've switched off the proxy. I got the opposite:

  • This page shows the prices in € (so it's working correctly, as I'm in Spain): hidden link
  • This page shows the prices in $ (so it's NOT working well): hidden link
  • Extra: the function: get_woocommerce_currency() shows the prices in British pounds (so it's NOT working well). I'm using that function to show the prices here: hidden link
  • _
    Note: this time I'm using a Chrome extension as Proxy (on an incognito window): hidden link

    August 23, 2020 at 4:12 pm #6854945

    carlos-helderG

    I think I've found one key of the issue: the currency is shown correctly when I clear the WordPress cache (NOT the internet browser cache: the website cache I mean).

    The following shows the correct currency ONLY WHEN I CLEAR THE CACHE:

  • hidden link
  • $currency_symbol = get_woocommerce_currency();
  • $current_currency = apply_filters('wcml_price_currency', get_woocommerce_currency() );
  • But that seems contradictory with my previous messages: Maybe because I execute the code on functions.php

     $current_currency = apply_filters('wcml_price_currency', get_woocommerce_currency() ); 

    , all the pages are working (but only when clearing the WordPress cache)??

    August 23, 2020 at 5:08 pm #6855133

    carlos-helderG

    Notice I've opened a new ticket about the specific cache problem here: https://wpml.org/forums/topic/show-currencies-based-on-client-location-cache-problem/

    August 25, 2020 at 11:54 am #6868079

    Yvette
    Supporter

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

    Timezone: Europe/Paris (GMT+02:00)

    Hello

    I´m still waiting on a reply from the developer with regards to how/if this would work with a proxy as you have set itup.

    The initial response form our 2nd tier support is that it currently only works on checkout and checkout actions.

    But now that you have opened the new ticket, is this ticket still "valid"?

    August 25, 2020 at 12:12 pm #6868331

    carlos-helderG

    I'm not sure because the answer of 2nd tier support confuse me.

    Because, as I showed you, it works in all the store (but I have to clear cache).

    But 2nd tier support says it only works on checkout.

    So I don't know if it's a cache problem (new ticket) or something different (this ticket).

    Do 2nd tier support know that it's working in the whole store when clearing cache?

    Thanks!

    Carlos