Skip Navigation

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

Problem:
In the second language, orders are being applied a coupon discount that should not exist.
Solution:
If you're experiencing this issue, we recommend trying the following workaround until a permanent fix is released in future versions of WooCommerce Multilingual & Multicurrency:
1. Navigate to

\WCML_Multi_Currency_Orders::total_is_changed

in

wp-content/plugins/woocommerce-multilingual/inc/currencies/class-wcml-multi-currency-orders.php

and edit the

class-wcml-multi-currency-orders.php

file.
2. Locate the following line:

if ( 'total' === $key && ( $item->get_total() !== $item->get_subtotal() || $this->total_is_changed( $item ) ) ) {

3. Remove this part from the line:

|| $this->total_is_changed( $item )

If this solution does not resolve the issue, consider adjusting the order total by adding the amount without the discount, and then directly create a new order or update the existing one (without saving the new total).
Please ensure that you have backed up your database before proceeding with any modifications.

Please note that this solution might be irrelevant, either because it's outdated or not applicable to your case. If this is the case, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket.

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.

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by Andrey 1 year, 2 months ago.

Assisted by: Andrey.

Author Posts
March 28, 2024 at 12:17 pm

pawelS-42

In the second language, orders are being applied a coupon discount that should not exist.

March 28, 2024 at 1:05 pm
March 28, 2024 at 2:26 pm #15461195

pawelS-42

Extra note.
First issue with coupons applied doesn't occur if I set product price manually.

With removing commas I couldn't reproduce it yet. I know that changing client email and order status removed commas from Euro prices 2 times already.

March 28, 2024 at 2:32 pm #15461209

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Hello, my name is Andrey, and I am here to assist you further. Can you please provide more details about the issue you are facing now?

Additionally, can you confirm if the issue persists when you temporarily deactivate all plugins except for WPML and WooCommerce and use the default Storefront theme?

Before making any changes, please ensure you have backed up your database.

March 28, 2024 at 2:42 pm #15461235

pawelS-42

Hi, I tested without any other plugins in my local test env.
There are 2 issues currently. Both present only in admin dashboard in order edit/add.

First one:
- with multicurrency option of WPML if I add order in not default currency and don't have price set manually in single product then while adding product to new order in admin dashboard price is calculated with coupons.
Order total is correct, but single item prices are incorrect. You see in screen that price is 2200€, while in real price is 550€. 2200 is price in PLN (default currency).

- when editing order in second currency (so far when happened two times) when I changed status from Processing to Completed, with WPML addon installed commas from price eg if price was 357.32€, it became 35732€ .

Before we used Fox currency switcher and never had such issues.

2024-03-28_13-20.png
March 28, 2024 at 2:59 pm #15461324

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for sharing your feedback with me.

After running some tests, I could not replicate the issue you mentioned. However, I might have missed certain conditions. To help me better understand the issue, I have created a fresh installation for you. Could you please help me on replicating the problem you are facing? I will send you a private message with an access link where you can provide further details.

March 28, 2024 at 3:00 pm
March 28, 2024 at 3:06 pm #15461346

pawelS-42

Go into order I created
hidden link

March 29, 2024 at 12:57 pm #15464413

pawelS-42

Hello,
Any update on that?

March 29, 2024 at 2:03 pm #15464576

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Hello,

I appreciate your patience. This issue will be addressed in future versions of WooCommerce Multilingual & Multicurrency.

In the meantime, you can try the following workaround:

– Go to \WCML_Multi_Currency_Orders::total_is_changed in wp-content/plugins/woocommerce-multilingual/inc/currencies/class-wcml-multi-currency-orders.php and edit the class-wcml-multi-currency-orders.php file

– Remove this from the line

|| $this->total_is_changed( $item ) 

in the line

				if ( 'total' === $key
				     && ( $item->get_total() !== $item->get_subtotal() || $this->total_is_changed( $item ) )
				) {

If the previous solution doesn't solve the issue, you can alternatively adjust the order total by adding the amount without the discount, and then directly create a new order or update the existing one (without saving the new total). I have attached a screenshot for your reference.

Before proceeding with any modifications, please ensure that you have backed up your database.

Add-new-order-‹-Sandbox-—-WordPress.png
March 29, 2024 at 6:09 pm #15465267

pawelS-42

Ok, this issue is resolved right now.

I can't reproduce second one (that it removes comma sometimes) right now, so maybe this fix also fixed that. I'll get back to you if comma remove issue will come back.

Thanks for your support!