Closed mariuszsienkiewicz closed 1 week ago
Talking a bit about the code fixes – implementing it the way I described ensures that orders with discounts applied to products will have the discount correctly handled, and there won’t be issues with discrepancies between the sum of the product values in orderLines and what we pass from PrestaShop as the total order amount. We had a situation where PrestaShop, after applying discounts, had an inaccuracy of 0.02 euros, which caused the code to malfunction and add as much as around 1.6 euros to one of the products – which is, of course, completely incorrect due to the faulty logic of this function.
Hi there @mariuszsienkiewicz,
Can you please provide us with the exact steps to recreate this issue? Product prices, discounts, and order total would be needed.
Thanks!
Best Regards, Invertus Support team.
I will provide you with more information soon, so please don't close this issue in the meantime. :)
@mariuszsienkiewicz,
When you are available, please provide more information. We created several discounts which were applied to cart and product, with several vouchers as well. Tried different discount types, but Klarna payments seems to be working fine .
Can we get configurations and shop information(ps version)
If you have any questions, please let me know!
Best Regards, Invertus Support team.
Hello there,
As this has been inactive for some time now, I am closing the issue.
If you are still facing it and decide to come back, please reply and with the answer and we will continue working.
If you have any questions, please let me know!
Best Regards, Invertus Support team.
There is an issue with how rounding inaccuracies are handled. The
compositeRoundingInaccuracies
function has some logical issues when a discount is applied to the cart. We have noticed this issue because Klarna didn't want to accept some of the orders.Below is a function that handles these inaccuracies more effectively:
With this fix, the issue from the TODO comment:
TODO: check why remaining comes -100 when testing and new total becomes different
should be resolved.