Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:

An issue with the WooCommerce Bookings plugin - Currency issue - price is not changing according to the country on the checkout page.

Solution:

Our compatibility developer has shared a workaround for this issue.

1. Take a backup of your site in case something goes wrong.

2. Edit the following file with a code editor.
/wp-content/plugins/woocommerce-bookings/includes/class-wc-booking-cart-manager.php

3. Find this line (should be line 21).

add_filter( 'woocommerce_get_cart_item_from_session', array( $this, 'get_cart_item_from_session' ), 10, 3 );

4. Comment it out like this:

//  add_filter( 'woocommerce_get_cart_item_from_session', array( $this, 'get_cart_item_from_session' ), 10, 3 );

5. Save the changes in the file.

Now, the problem should be solved, and while on the checkout page, when you switch to a country other than Sweden, the currency will change.
Please be aware that the suggested workaround might have other effects we are unaware of.

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 Itamar 1 year, 3 months ago.

Assisted by: Itamar.

Author Posts
October 24, 2023 at 10:45 am #14646425

annaW-22

I am trying to: in checkout I'm changing my country to a country that should have EUR instead of default currency SEK. Then the currency symbol change, but the amount is the same. (it should be 1 SEK = 0.1 EUR). (see attached image)

Link to a page where the issue can be seen: hidden link

I expected to see: 100 EUR when I switch from Sweden to any other country

Instead, I got: 1000 EUR

I have set up a testa site for you to try this on:

hidden link

--Removed by support--

Best,
/Kristina

Skärmavbild 2023-10-24 kl. 12.42.54.png
Skärmavbild 2023-10-24 kl. 12.43.05.png
Skärmavbild 2023-10-24 kl. 12.42.42.png
October 25, 2023 at 8:36 am #14658305

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Kristina.

Firstly, since the forum is public for the safety of your site, I request you not to post login details until we ask or use the private login form while creating the ticket to send the login details; I have removed the login details from the ticket.

I checked this issue on your site and I don't see the problem you are talking about. On the checkout page, when I select "Sweden" I get the correct currency and amount - 2000kr. Please see the attached screenshot sweden-ok.jpg.And when I select "Switzerland" I get 200.00 EUR. Please see the attached screenshot switzerland-ok.jpg.

Maybe you fixed this problem already...
Can you see if it is OK now?

For reference please review our WooCommerce Multilingual & Multicurrency guide here.

https://wpml.org/documentation/related-projects/woocommerce-multilingual/multi-currency-support-woocommerce/#currencies-per-location

Regards,
Itamar.

sweden-ok.jpg
switzerland-ok.jpg
October 25, 2023 at 9:14 am #14658625

annaW-22

Hi,
No, it's not working for me. I'm using Chrome in inkognito mode, I have emptied Kinsta cache.
See attached images.
/Kristina

EUR.png
SEK.png
October 25, 2023 at 11:02 am #14659965

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

OK, I can see this problem when I use Chrome in incognito mode. Please see the attached screenshot.

Do you confirm that this problem only happens in incognito mode?

2023-10-25_13-57-37.jpg
October 25, 2023 at 11:36 am #14660357

annaW-22

Hi, No for me it happens all the time in all windows, private or not.

October 25, 2023 at 1:50 pm #14661721

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

I see.

Are you located in Sweden?

If the problem persists, please share with us WordPress's debug log (not WPML debug information). Please check this page for instructions.

https://wpml.org/documentation/support/debugging-wpml/

To enable it, open your wp-config.php file and look for

define('WP_DEBUG', false);

Change it to:

define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);

After this, repeat the action that causes the problem on your site. In this case, the errors will be saved to a debug.log log file inside the /wp-content/ directory. Then please share the errors with us.

Thanks,
Itamar.

October 26, 2023 at 8:04 am #14667337

annaW-22

Yes, I'm located in Sweden. I'm not getting any errors?

October 26, 2023 at 9:23 am #14668551

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Thanks.

I suspect that there is a collision with the theme or another plugin that might cause this problem. If possible, get your site into a minimum environment. A Minimum environment means switching to a default WordPress theme like Storefront (https://wordpress.org/themes/storefront/) and having no plugins activated except WPML.

First, you will need to check if the problem persists when the theme is switched to Storefront (for example). If it persists, then deactivate all plugins except the WPML, its add-ons, and WooCommerce itself (without its extensions). Then please check if the problem persists. If it does not persist, start by activating the plugins one by one and check when the problem comes back, then report to me which was the culprit plugin.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****


*** If your site is live, you might want to try those procedures in a staging environment or a snapshot of your site on your local server or another server. ***

October 27, 2023 at 10:30 am #14677521

annaW-22

Hi, I have changed the theme to Storefront. Still same issue.

hidden link

I have seen this before in you support forums, this is a known issue. There must be a fix for this issue?

/Kristina

Skärmavbild 2023-10-27 kl. 12.24.39.png
Skärmavbild 2023-10-27 kl. 12.24.47.png
October 29, 2023 at 9:34 am #14685853

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Kristina, and thanks for following my suggestion.

I'm still unable to reproduce this problem. I even tried reproducing it while connected with a VPN through Sweden and in incognito mode. Please see the attached screenshots.

Does it happen with a specific product?
Can you please tell me the exact steps I should take to replicate this problem?

You mentioned that you have seen this problem before in our forum. We have the following known issues page, and I cannot find a similar open issue.

https://wpml.org/known-issues/

Can you please share with me what you have found?

If you need further help with this, please share the access details to your site with me. I'm enabling a private message for the following reply.
Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--

Regards,
Itamar.

Screenshot 2023-10-29 112118.png
Screenshot 2023-10-29 112151.png
October 31, 2023 at 2:33 pm #14700973

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, and thanks for the access details.

Thanks, I can see the problem with the bookable product you gave as an example. The multicurrency settings on your site seem to be all right.

I suspect that there is a collision with the theme or another plugin that might cause this problem. If possible, get your site into a minimum environment. Minimum environment means switching to a default WordPress theme like TwentyTwenty-One and no plugins activated except WPML.

First, you will need to check if the problem persists when the theme is switched to TwentyTwenty-One (for example). If it persists, then deactivate all plugins except the WPML and its add-ons, WooCommerce itself, and WooCommerce Bookings. Then please check if the problem persists. If it does not persist, start by activating the plugins one by one and check when the problem comes back, then report to me which was the culprit plugin.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****


*** If your site is a live site, you might want first to try those procedures in a staging environment or a snapshot of your site on your local server or another server. ***

Thanks,
Itamar.

October 31, 2023 at 3:23 pm #14701769

annaW-22

It's obviously the WooCommerce Booking plugin that is the issue. I have deactivated all plugins and changed to Storefront theme and it works with

hidden link

but not with hidden link

So WPML and WooCommerce Multilingual is not compatible with WooCommerce Bookings?

Can you please help us fix this because this whole site is built on bookings!

/Kristina

November 1, 2023 at 2:30 pm #14708241

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Kristina.

We need to replicate this issue on a fresh WordPress installation. Then, I'll be able to escalate it to our compatibility team. For this, I created a test website with a clean WordPress install. You can access it through this link:

hidden link

With this link, you'll be directly logged in.

Could you please install the WooCommerce Bookings plugin and see if the issue is replicable on a clean WordPress installation?

I've already configured WPML to have English as the default language and Swedish as the second language (the same as on your site.) Please configure WooCommerce and the WooCommerce Bookings plugin as set on your site (just the basic configurations needed to replicate the issue are enough). Please also make sure that you are installing the latest version of the plugin. When everything is finished, and you can replicate the problem, please let us know.

Thanks,
Itamar.

November 2, 2023 at 9:44 am #14714721

annaW-22

Hello, Yes, it's still not working. When I found people in your forum with similar issue, it seems to be when the default currency is not EUR.

hidden link

I'm using the product above. Please test for yourself.

See my attached images.

/Kristina

Skärmavbild 2023-11-02 kl. 10.43.19.png
Skärmavbild 2023-11-02 kl. 10.43.08.png
November 2, 2023 at 4:47 pm #14719873

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Thanks a lot for replicating the issue on the test site.

I've escalated this issue to our compatibility team. I'll update you on any news regarding this issue.

Thank you for your patience.
Itamar.