Jump to content

Rounded price is displayed but unrounded price is used for calculations


Jacek Es

Recommended Posts

Hi,

I have discovered this on PrestaShop 8.1.7. It applies to rounding methods: Round on each line and Round on total when currency Decimals is set to 2. PrestaShop 8.1 rounds Unit Price with discount applied value but uses unrounded value for further calculations. This makes the calculations appear wrong.

Example:
Product base price: £0.30
Discount from 1000pcs: 31%
Product price with discount applied: £0.207 (rounded to £0.21)

PrestaShop makes the following calculations:
image.png.f378e41729f5b117002ff113d1a88246.png

£0.21 * 1000 cannot be £207.00

The problem is that rounded Unit Price with discount is displayed (£0.21) but unrounded value is taken to the calculations (£0.207).

 

Possible approaches to correct this:

1. Display rounded value and use it for further calculations (as it was in PrestaShop 1.6):

£0.21 * 1000 = £210.00

2. Display unrounded value and use it for further calculations (but the shop is set to 2 Decimals which is an issue):

£0.207 * 1000 = £207.00

How to fix this?

Thanks

 

 

 

Link to comment
Share on other sites

There would be a sense to it - to have calculations on the invoice and during checkout process that are mathematically correct. You cannot have the following:

£0.21 * 1000 = £207.00

You can either have:

£0.21 * 1000 = £210.00
or
£0.207 * 1000 = £207.00

Don't you agree?

 

In PrestaShop 1.6 with Classical rounding mode the calculations were made correct - the rounded value was displayed and used for the calculations:
image.png.fcfcd2f798a6575ad73add2a6f80d79c.png

 

Link to comment
Share on other sites

  • 4 weeks later...
  On 10/31/2024 at 1:37 PM, Nickz said:

if you like the way Prestashop 1.6 handled the issue, then use 1.6.

Expand  

What a stupid response!
Objectively, the new rounding system in PrestaShop 8.x has several flaws.
Many times, when I set a tax-inclusive price, for example, "8€", PrestaShop saves it as "8.0000001". This is likely due to the double calculation (Tax-inclusive price --Calculate--> Tax-exclusive price --Recalculate--> Tax-inclusive price). And while this may seem like a minor issue, it often causes confusion and poor impressions for customers making purchases. I’ve tried solving it in various ways, but the problem persists (especially during invoice generation). Similar issues, of course, are also present with specific prices.

Now... we can either calmly acknowledge the issue and try to address it (at the core level), or we can blindly respond to such concerns with a curt: "use version 1.6 if you like it so much." But this approach will only push professionals to adopt other e-commerce platforms.

Link to comment
Share on other sites

Thanks MadMar. I didn't want to comment on the previous reply no to heat up emotions but you are spot on it.

You are right... the new rounding system has flows and these aren't easy to fix. I have even hired a professional  PrestaShop developer. He initially quoted the task for 2-3 days work but is already on it for 3 weeks.

From the possible approaches that I suggested:

1. Display rounded value and use it for further calculations (as it was in PrestaShop 1.6):

£0.21 * 1000 = £210.00

2. Display unrounded value and use it for further calculations (but the shop is set to 2 Decimals which is an issue):

£0.207 * 1000 = £207.00

he has already abandoned the approach 1. above. He is now trying to implement the 2nd approach but it's a messy road.

 

Your suggestion seems to be the best - address the issue at the core level

Link to comment
Share on other sites

  • 3 months later...

Hello Jacek Es,

Did you manage to solve this problem?

I have the same issue. 

The order comes in with the correct item price (10.80), but when I generate the invoice sometimes the price on the order changes (10.81) but o the invoice is 10.80

I use an external billing program.

The Price is: 9.075630 VAT excl. and 10.80 VAT incl.

My rounding option are:

- Round up away from zero, when it is half way there.

- Round on each item

 

 

Link to comment
Share on other sites

Hi,

 

No, sadly I haven't. It appears this issue is not straightforward to fix. Sadly no one from PrestaShop cares even to reply to this Bug report. The issue has been reported by others on other forums but still no solution.

Good luck!

Link to comment
Share on other sites

  On 3/20/2025 at 3:22 PM, Jacek Es said:

No, sadly I haven't. It appears this issue is not straightforward to fix. Sadly no one from PrestaShop cares even to reply to this Bug report. The issue has been reported by others on other forums but still no solution.

Expand  

If you are all un happy with the Prestashop solution you could move. 
Prestashop is going the SaaS way You rent the shop and get what they offer. you wich for more you pay their prices..

 

Link to comment
Share on other sites

  On 3/20/2025 at 3:22 PM, Jacek Es said:

No, sadly I haven't. It appears this issue is not straightforward to fix. Sadly no one from PrestaShop cares even to reply to this Bug report. The issue has been reported by others on other forums but still no solution.

 

Expand  

Report on the GitHub. I don't think the Prestashop core team is checking the Forums. 

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
  On 3/20/2025 at 5:07 PM, Nickz said:

If you are all un happy with the Prestashop solution you could move. 
Prestashop is going the SaaS way You rent the shop and get what they offer. you wich for more you pay their prices..

 

Expand  

Hey, I think it's time to dial it back a bit.
I've already explained that this isn't about being ungrateful for what PrestaShop offers.
To use an analogy: if someone gives me a car with square wheels, I can't just pretend everything is fine simply because "it was free."
And replying with "just use something else if you don't like it" doesn't really add much to the conversation.

No one here said PrestaShop is garbage.
We're trying to have a constructive discussion to understand if this issue is isolated or affecting multiple users — so that we can possibly open a GitHub issue and ask for a fix or clarification.
That's how the open-source ecosystem works.

So please, let's keep the conversation mature and relevant. Your tone and comments so far haven’t really helped move the discussion forward. If you don't have anything useful to add, it might be best to take a step back.
Thanks.

Link to comment
Share on other sites

  On 3/21/2025 at 6:16 AM, Knowband Plugins said:

Report on the GitHub. I don't think the Prestashop core team is checking the Forums. 

Expand  

Would you mind sharing the link to the report that was opened, please? I'd like to subscribe to it and follow any updates.

From what I’ve read, it seems that this kind of issue won’t be addressed in the 8.x versions, as it’s considered a structural limitation.
There’s a chance we might see some improvements in version 9, hopefully.

We’ll most likely need to upgrade to version 9 when the time comes.
I just hope the migration won’t bring along too many complications.

Edited by MadMar (see edit history)
Link to comment
Share on other sites

  On 4/16/2025 at 12:07 PM, MadMar said:

Your tone and comments so far haven’t really helped move the discussion forward. If you don't have anything useful to add, it might be best to take a step back.

Expand  

Really? Are you capable to read a tone out of a written text?
Who decides what is useful? You?

You don't need to react to the posts I write. Its much healthier rather than sucking in negativity. Just a suggestion.

By the way: Its the way Presta is going not me judging it.
In view of the success shopify seems to generate Presta decided to go SaaS, so did others, Gambio, Shopware,...

  On 3/20/2025 at 5:07 PM, Nickz said:

If you are all un happy with the Prestashop solution you could move. 
Prestashop is going the SaaS way You rent the shop and get what they offer. you wich for more you pay their prices..

Expand  

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...