Describe the bug
In the function getPackageShippingCost, the result value is always rounded to 2 decimals, This leads to errors in the cart totals calculations, in the invoices and in the emails templates.
The actual code is:
$shipping_cost = (float) Tools::ps_round((float) $shipping_cost, 2);
It should be:
$shipping_cost = (float) Tools::ps_round((float) $shipping_cost, 6);
To Reproduce
Simply check the result of the totals calulations in shopping cart.
Additional information
PrestaShop version: all
PHP version: 7.2
Hi @stefanovita,
Thanks for your report.
I tried with PS1.7.6.1 with a default product.
In the BO
In the shopping cart FO is well calculated
PS: It's planned to remove the number of decimal parameters in Shop parameters > General.
You can follow this ticket: https://github.com/PrestaShop/PrestaShop/issues/12223
And it's also planned to add this feature in CLDR part 2: #11660
Thanks to check & feedback.
The problem is with the shipping cost, not the product price.
@stefanovita, sorry, it is my bad.
I tried with this price shipping => 7.145000, in the FO => It will display €7.15
I tried with this price shipping => 7.1447, in the FO => It will display €7.14
I attached a screen record
https://drive.google.com/file/d/16yK0ZiNZQfjrr2wP-bJx-9u5AkV2Bdxe/view
Thanks to check & feedback.
Hi @stefanovita,
Since we had no news from you for more than 30 days, I'll close this ticket. Feel free to open another one if you can give specific details.
Thanks!
Most helpful comment
The problem is with the shipping cost, not the product price.