Skip to content

@firstred firstred released this Jun 24, 2017 · 90 commits to master since this release

Finally, we have been able to verify that the terrible rounding issues have been solved. We have been testing until we no longer had any rounding issues. Cart rules, catalog price rules, free shipping and 0 decimal places, it doesn't matter anymore. The PayPal module applies the rounding in such a way that the cart total on PayPal will always be the same as thirty bees'.

Unfortunately discounts have to be calculated in a different way. A thirty bees contributor notified us about the possibility to use the shipping_discount field. As a result, all the discounts that could not be applied in the PayPal way end up on this field, so the calculation for PayPal will always be correct. This is what it looks like:
shippingdiscount
In this example we have added the first "Bedrukte Jurk" 3 times and a cheaper "Bedrukte Jurk", just once

In case there are multiple products on a cart line of which the last product has a different price (due to rounding), we apply a technique invented by Magento quite a while ago. PayPal always forces a rounding of 2 decimals PER ITEM. This means that if rounding occurs on one line, it will no longer match PayPal if you add the exact quantity at once. To solve this we add an item of quantity = quantity - 1 with the normal price, then an item of quantity = 1 with the deviating price. That effectively always synchronizes the cart line total with the total on PayPal, but might make some products appear separately on the item list. No worries, this is effectively how you calculate the cart subtotals on your thirty bees invoice as well.

You can go ahead and try this version if you use discount coupons in your store. In case it still doesn't solve the rounding problems for you, we would like to hear from you. Please provide us with a full dump of your Cart (preferably the Cart object in thirty bees), so we can analyze what rounding errors might still be left. Thank you!

Assets 3
You can’t perform that action at this time.