Jump to content


Use this forum to post questions if you're looking for some specific module or if you need help with modules not listed below.
Photo

Making Specific Prices consistent on PrestaShop 8

pricing discounts prestashop 8.x rounding specific prices discounted prices

  • Please log in to reply
No replies to this topic

#1 gebiss

gebiss

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 31 October 2024 - 09:17 AM

Hi,

 

I am wondering if is possible to write a module (or fix the issue in any other way) for PrestaShop 8 that would make the product discounted prices (Specific prices) consistent throughout the shop and ordering process.

 

The issue comes from a fact (maybe it should be considered as bug) that PrestaShop 8.1 rounds Unit Price value, displays it but uses unrounded value for further calculations. This makes the calculations wrong. Example:
 
Product base price: £0.30
Discount from 1000pcs: 31%
Product price with discount applied: £0.207
 
PrestaShop 8.1, rounding method: Round on each line or Round on total makes the following calculations:
Screenshot2024-10-30at17_25_49.png.439ed
 

£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)

 

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

Screenshot2024-10-30at16_57_29.thumb.png

 

Possible approaches to resolve 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 (without increasing the currency Decimals for the entire shop) and use it for further calculations:
 
£0.207 * 1000 = £207.00
 
Can this be done or approached in any other way?

 

 

 

 


#2 shanabell7

shanabell7

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 13 May 2025 - 07:04 AM

To resolve this, I partnered with the FME Modules development team, and they helped me build a custom PrestaShop module that ensures rounding consistency across:
  • Product listings
  • Cart summary
  • Checkout process
  • Invoices and order confirmation
  • Back-office order views
 
This module forces PrestaShop to use the same rounded price both for display and for calculations—much like how it worked in older versions like 1.6 with classical rounding mode.
 
How It Works Behind the Scenes
The module hooks into the pricing logic of PrestaShop 8 and applies:
  • Consistent rounding based on your store’s configuration (e.g., round per line vs total)
  • Manual override of the unit price calculation when discounts are applied
  • Correction of line totals to reflect rounded display price × quantity
  • Compatibility with tax rules, currencies, and different pricing rules
  • It basically restores the WYSIWYG principle: What you see is what you’re charged—no more rounding surprises.
Tested & Working Smoothly
This module is working flawlessly in my live store, including during:
  • Promotions with complex discount rules
  • Multi-currency transactions
  • Large B2B orders with quantity-based pricing





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users