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.

No supporters are available to work today on this forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 10:00 8:00 – 10:00 8:00 – 13:00 8:00 – 13:00 9:00 – 13:00 -
- 11:00 – 17:00 11:00 – 17:00 14:00 – 17:00 13:00 – 17:00 13:00 – 18:00 -

Supporter timezone: America/New_York (GMT-05:00)

This topic contains 3 replies, has 0 voices.

Last updated by Lauren 3 days ago.

Assisted by: Lauren.

Author Posts
September 24, 2024 at 2:01 pm #16215270

jochenS

Background of the issue:
I am facing the same issue as described here: https://wpml.org/forums/topic/order-prices-change-on-status-change-in-alternative-currency-woocommerce-multilingual/. Orders process as expected, but if an order needs to be re-triggered (e.g., for a repeated API call to the warehouse system – WooCommerce status changes from 'Completed' back to 'In Progress'), the order prices lose their separators, which causes them to be manipulated. I have installed the most recent update of WooCommerce and Multicurrency. The default currency in WooCommerce is EUR, and the secondary currency is USD. Unfortunately, the suggested solution (matching the separators with those of WooCommerce's native format) is not an option for me. I tried that, and while it does solve the bug, it results in incorrect separators for my USD prices.

Symptoms:
Order prices lose their separators and are manipulated, resulting in significantly higher prices when the order status changes from 'Completed' back to 'In Progress'.

Questions:
How can I prevent order prices from losing their separators when the order status changes?
Is there an alternative solution to matching the separators with WooCommerce's native format that does not result in incorrect separators for USD prices?

September 25, 2024 at 5:45 pm #16222182

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

I have escalated this issue to our developers. In the meantime, there is a workaround but I must warn that it has not been tested and while it resolves the issue on my test site, I don't know what other issues it could cause, so please proceed with a full back up and caution.

We disable our logic by going to : wp-content/plugins/woocommerce-multilingual/inc/currencies/class-wcml-multi-currency-prices.php and comment-out the line:

add_filter( 'option_woocommerce_price_decimal_sep', [ $this, 'filter_currency_decimal_sep_option' ] );

After I did this on my test site, the issue was resolved. The other option is to change the USD decimal separator to a comman. This makes the price look a bit funny on the frontend, but it wouldn't have unknown consequences like editing the code.

I will update you here once our developers have a more pernament solution.

September 30, 2024 at 9:39 am #16235205

jochenS

Hello Lauren, i solved it for my case now with this Hardcode:

In the unit mentioned: wp-content/plugins/woocommerce-multilingual/inc/currencies/class-wcml-multi-currency-prices.php , manipulate the line with an is_admin switch:

```php
if (!is_admin()) {
add_filter( 'option_woocommerce_price_decimal_sep', [ $this, 'filter_currency_decimal_sep_option' ] );
}
```

While this fix resolves the issue perfectly for our case, for WCML work still needs to be done. SO, thanks for the hint so far.

Please let me know if there are any recent updates for this topic (fkraetzig@hofa.de)!

greetings from Germany.

Frank.

September 30, 2024 at 12:50 pm #16236190

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

Thanks for the update! We will be including a permanent resolution in a future release. Glad to know the workaroudn resolves it temporarily. I will let you know once we have a confirmed release available.

November 13, 2024 at 12:43 pm #16397612

jochenS

Is there an update aviable, yet?
Another question: I am struggeling to identify which changelog this issue actually belongs to - wpml or wcml, actually?

Greetings from Germany,
Frank.

November 13, 2024 at 3:58 pm #16398517

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

Other than the previous workaround, we do not have a permanent fix yet. The workaround earlier provided is what is suggested, and this is still escalated to our developers. Ultimately it's up to our developers to determine priority and schedule, and I will update here once I have more information.