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 54 replies, has 5 voices.

Last updated by Jamal 3 months, 2 weeks ago.

Assigned support staff: Jamal.

Author Posts
May 23, 2019 at 6:53 am #3871581

tonyL-9

I am trying to:
Run a multi-currency ecommerce with WPML and WPML Multilingual with automatic currency conversion through Currencylayer API.

It seems to work as expected for 2-3 days then we got an issue. It seems the prices for some (5-10 products out of 192) products are displayed wrong. The price seems to be (probably get converted in some way) about a tenth of what they should be.

Our setup is the following:
- Base currency SEK (swedish krona)
- Product prices are set in SEK
- Visitors should be able to switch currency (SEK, EUR, AUD, CAD, CHF, DKK, GBP, NOK and USD)
- We're using WPML Multilingual currency switcher
- Automatic exchange rates (daily updated through Currencylayer)

We've contacted Currencylayer just to confirm that the issue is not related to their service or to them in any other way. They said that it most likely is related to WPML Multilingual and that they've heard of the same problem from other customers running WPML.

We are not sure but it might be when a visitor switches currency, places an order on lets say Product #1 after that the price on Product #1 is wrong. The thing is that when price is wrong its the right one in the database but wrong on frontend. Maybe thats helping you a bit further on investigating and/or replicating the issue.

Is this a known issue? What can we do to solve it?

Thanks in advance.

May 23, 2019 at 9:57 am #3873233

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML support!

Can you tell me if you replicate the same issue like this?
https://wpml.org/forums/topic/critical-bug-product-price-changed-when-bought-on-secondary-currency/

If yes, can you try this and test after that?
https://wpml.org/forums/topic/critical-bug-product-price-changed-when-bought-on-secondary-currency/page/2/#post-3833015

Regards,
Bruno Kos

May 23, 2019 at 10:27 am #3873737

tonyL-9

Hi,

Thanks for your quick response!

Sounds like it could be the same issue. I've tried to replicate the issue we have on the live ecommerce on our staging but doesn't seem to happen.

Just a couple of quick questions:
"- Update WordPress
- Clear transients in WC >> Status > Tools
- Run troubleshooting WPML options"

"Update WordPress" - I guess you mean, we should have latest version of WP?
"Run troubleshooting WPML options" - Where do we find this option?

May 23, 2019 at 12:22 pm #3874949

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

The troubleshooting options are here:
Can you try the following:
- WPML - > Support -> Troubleshooting:
-- Clear the cache in WPML

I've tried to replicate the issue we have on the live ecommerce on our staging but doesn't seem to happen.

So for these affected products, this is also not happening when you test? Our other clients are experiencing this scenario:
- somebody orders a product in translated language
- the price of the original changes to that purchased price, but since it is another currency, the issue is major because somebody can order a product in original language for a much lower price

One thing to note is that even though the price shows properly in the backend (after the product has been purchased), if you open the product directly, you will see the wrong (new price).

Regards,
Bruno Kos

May 23, 2019 at 1:02 pm #3875535

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

I think it can be replicated only once. Once you update the product it is fine. In your tests were you able to replicate the issue more than once on same products?

Regards,
Bruno Kos

May 23, 2019 at 1:07 pm #3875545

tonyL-9

Hi,

I'll try on the live ecommerce store soon.

But i think you're right, if i look at the orders that have been placed when the prices were wrong it seems that the same product isn't showing up more than once with wrong price after the prices have been changed back.

I will get back as soon as i've tried your suggested fix.

May 23, 2019 at 1:33 pm #3875779

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

Ok, let me know how it goes and I can help any further.

Regards,
Bruno Kos

May 24, 2019 at 7:03 am #3881677

tonyL-9

Hi Bruno,

I tested your suggested solution now and the problem still exists.

I think I see a pattern on the live site now.

1. Customer switches currency (from SEK to USD)
2. Prices is displayed in USD (the correct price is shown)
3. Customer places an order.
4. Admin user has USD predefined instead of base currency SEK. It seems that the last selected currency from customer is now set to logged in users (administrator) which is USD. I'm not 100% sure but it might be converted with the same exchange rate once again?
5. The product page now displays 3.76USD instead of 280 SEK. (280SEK is stored in database)

Product from order:
Original price 280 SEK -> 29.05USD (converted from SEK to USD) -> 3.76USD (after order is placed it gets converted once again and added local taxes which is 25%, even though currency is displayed as USD and not SEK).

If i divide 29.05USD/280SEK i get 0.10375 (exchange rate). 280*0.10375 = 29.05USD. 29.05*0.1375*1.25 = 3.767421875.

Sounds right? I can't confirm if earlier ordered products which has changed price will change again.

May 24, 2019 at 9:55 am #3883053

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

I can't confirm if earlier ordered products which has changed price will change again.

Can you test this using gateway such as Check payments and limit its visibility only for the site administrator? I think that a plugin such as this one might help:
https://wordpress.org/plugins/payment-gateways-by-user-roles-for-woocommerce/

Regards,
Bruno Kos

May 28, 2019 at 7:24 am #3903413

tonyL-9

Hi,

The problem is that i can't enable multi-currency on the live site since the currencyswitcher will be shown to visitors and the prices will change. Could you go ahead with my detailed description of the problem and fix it?

May 28, 2019 at 10:52 am #3905855

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

Can I ask you the following then? In order to debug this issue , can you install Duplicator plugin and create package so that I can try this on my localhost and possibly escalate further to 2nd tier?

https://wpml.org/faq/provide-supporters-copy-site/

Let me know if this is OK with you.

If yes, I will need WordPress admin username and password so I could download those packages. I have marked your next reply private so you can safely add this information.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
Please make a full backup of your site before sharing this info!

Apart from this, please give me the link of:
- product on which the issue is to be seen and can be replicated
- exact steps to reproduce (I assume that 1) - 5) from your previous reply?)
-- if the above keeps happening for some product, let me know so that our 2nd tier can properly debug this

Regards,
Bruno Kos

May 29, 2019 at 10:35 am #3914225

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

Bruno will not be working this week, if you don't mind, I'll continue with you on this ticket.

I successfully rebuilt a local copy from your site. Then I found several products with 280SEK in price, I am not sure which one to test with.

Can you please specify a product to test with?

I believe I should follow 1-5 steps from your reply #3881677, would you confirm that?

Thank you,
Jamal

May 29, 2019 at 11:19 am #3914779

tonyL-9

Hi Jamal,

Sure, I'll be happy if you could continue with this ticket.

Great! I don't think it matters which one you try with. You could try any and see if the problem will show up.

Yes thats right. Just to clarify #5, you should check one of the ordered products and see if price has changed.

May 29, 2019 at 1:10 pm #3915797

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

Thank you for your feedback. But I still don't see how to reproduce the error. I am stuck on the first step. How can I switch currency? There is no currency switcher or language switcher to help me do that.

Can you please record a short video of the experience? I often use screencastify or loom for that.

Thank you,
Jamal

May 29, 2019 at 1:35 pm #3916007

tonyL-9

Sorry, I should have told you that "multi-currency" is disabled on the live site (which is the copy you've got). You need to enable multi-currency (WooCommerce > WooCommerce Multilingual > Multi-currency > "Enable the multi-currency mode").

When enabled you should be able to see the currency switcher in header and footer.

The topic ‘[Closed] Multi-currency, getting wrong prices on frontend (correctly stored in database)’ is closed to new replies.