Product prices rounding issues when updating tax prices

Service Provider
Frá Netherlands
Meðlimur síðan des. 2023

Updating pricing using the tax-inclusive field leads to weird rounding issues.

Here's how to reproduce:

[ol]
[li]Open a product from the catalog and go to the "Prices" tab.[/li]
[li]Adjust the value in the right box on the bottom, the price including taxes field, change it to "23".[/li]
[li]Save the product.[/li]
[li]Navigate back to the same product using the catalog, open the "Prices" tab.[/li]
[li]Notice how the prices listed are different from what was entered in step 2.[/li]
[/ol]

Here's what I would expect:
[ul]
[li]The values entered in step 2 remain the same in step 5, there's no change in the numbers.[/li]
[/ul]

Here's some potentially relevant webshop configuration:
[ul]
[li]Prices in EUR.[/li]
[li]Taxes always displayed.[/li]
[li]No relevant errors in the error log.[/li]
[li]Table 'lc_products_prices' has collation 'utf8mb3_general_ci'.[/li]
[/ul]

Service Provider
Frá Netherlands
Meðlimur síðan des. 2023

Thanks alins for the workaround! The problem is that the numbers change between saving and editing again later, which to me seems to indicate there's a discrepancy between the javascript calculations and the backend calculations. I have the suspicion that decimal point accuracy also plays a role here.

Doing the calculations manually is indeed an option to work around this, but why offer the field if it doesn't work? Either the form input should work as intended and allow bi-directional input without rounding issues in the different implementations, or it should be read-only as an information display only. That way, people can't make the mistake of setting a product price to a certain amount, and it then changing without their knowledge.

Service Provider
Frá Netherlands
Meðlimur síðan des. 2023

Hi alins,

The currency is set to EUR, with 2 decimals, EUR is set as default currency. In the Litecart settings, it is configured that prices are displayed including tax. The rounding is activated. If I deactivate the rounding, I can still reproduce the problem using the steps I described in my original report.

Again, I would like to stress the problem is not the rounding itself. My problem is the system changing product prices on me after I've set a price for a product without informing me. The rounding happens after I've pressed save and have been redirected to a different webpage, leaving me with a product price that has been changed without my consent/knowledge.

Designer
Frá Turkey
Meðlimur síðan apr. 2019

take a look at other posts on this topic in the forum. Maybe you will find some explanations that will help you more. English is not native language.

Service Provider
Frá Netherlands
Meðlimur síðan des. 2023

Hi Tim,

Sorry for not getting back to you sooner. I just tested commenting out the line and this seems to fix the issue. Now when I edit prices in the backend and re-open the same page, the prices are the same.

The prices in the frontend are now also correct and as I expect them.

Should I create a vMod for this for myself or will you fix it upstream? I'm not sure if commenting out this line breaks other functionality if you were to include it upstream.

tim
Founder
Frá Sweden
Meðlimur síðan maí 2013
tim

Thank you for reporting back. Glad to hear this solved your problem.
I have added a fix for the next release.

Þú
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.