PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Rounding of the resulting price in order administration

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hi,

I can't find the reason. When the customer creates an order, the price of the entire order is 29.61 Euros.

In order administration, the resulting price is rounded to 30.00, but the correct price is 29.61 Euros.

Don't know where the problem might be? Euro is not the default currency. In databaze is correct 29,61

https://postimg.cc/HjQVvPNJ

Thank you for your help

Hello

Do you use custom code to round prices?

Сan you disable the plugin and do a test?

The rounding code is not used.

In the default currency CZK, we have no decimal places. After disabling the plugin, the Euro currency would not be in the system.

Thank you for help

Hello

Please drop me exact link to the issue

Hi,

elabela.cz webpage.

Rounding will only occur after the customer has created an order

Hello

What plugin version number are you using?

I checked the site, I doubt that this is the functionality of our plugin, it looks like third-party customization.

If our plugin does not change the price on the front then it cannot change it on the order page.

Are you using custom code for prices?( not for rounding )

Hi,

version is 1.4.2.3.

I couldn't find any code that would round.

The price is displayed to users e.g. 49.69 but in the administration the total price is rounded to 50.00.

The main currency has no decimal places set. The second currency has two decimal places.

I'm looking for the cause in various forums, nothing found yet.

Thanks for any help. We are thinking of buying the paid version if all goes well.

 

I've probably already identified the problem. If I call the order values ​​via the REST API, they are rounded to whole numbers without decimal places. If it is 1.49, it is rounded to 1, and if the value is 1.55, it is rounded to 2.

The main currency is set to 0 decimal places and the second currency to 2.

16,53 €  3,47 € is correct. REST API show 17 a 3.

           "id": 12284,
           "name":"Deodorant - náplň - Kokos a tonka - CORE",
           "product_id": 8057,
           "variation_id": 8062,
           "quantity": 1,
           "tax_class":"",
           "subtotal":"17",
           "subtotal_tax":"3",
           "total":"17",
           "total_tax":"3",
           "taxes": [

I've probably already discovered the cause. It's caused by HPOS, which doesn't accept the number of decimal places set for two different currencies.

https://wpml.org/forums/topic/currency-decimal-causes-issue-with-purchases/

I will try turning off HPOS and wait for the result

Hello

Ok!  Try  in file - \plugins\woocommerce-currency-switcher\index.php - comment this line - https://share.pluginus.net/image/i20241122104037.png -  and do a test

Turning off HPOS fixed the problem.

I will test your solution later, if possible. At the moment, there are many orders in the e-shop.

Hello

ok! I have passed this on to the developers. We are investigating this.

There is a rounding error in user emails and when calling the REST API for orders.

I have already found the cause. If I set the number of decimal places to two for both currencies. That's fine.

"id":12392,
"parent_id":0,
"status":"processing",
"currency":"EUR",
"version":"9.4.1",
"prices_include_tax":true,
"date_created":"2024-11-26T21:04:19",
"date_modified":"2024-11-28T12:19:09",
"discount_total":"0.00",
"discount_tax":"0.00",
"shipping_total":"5.78",
"shipping_tax":"1.22",
"cart_tax":"4.24",
"total":"31.41",

If the main currency CZK has 0 decimal places set and EUR has 2 decimal places set. So also for EUR it is rounded to 0 decimal places in emails and when calling the REST API.

"id":12392,
"parent_id":0,
"status":"processing",
"currency":"EUR",
"version":"9.4.1",
"prices_include_tax":true,
"date_created":"2024-11-26T21:04:19",
"date_modified":"2024-11-28T12:19:09",
"discount_total":"0",
"discount_tax":"0",
"shipping_total":"6",
"shipping_tax":"1",
"cart_tax":"4",
"total":"31",

If the problem is solved, we will buy the full version.

Thank you

Hello

Ok! Great! Welcome;)