Dynamic Discounts – Wrong amounts in cart
-
Hello, having some trouble with the dynamic discounts. Some of the values in the checkout page don’t add up! Will provide some context and screenshots.
Is it a rounding off issue?
Attachments:
You must be
logged in to view attached files.
Hello,
May I disable the 3rd party plugins and enable the parent theme for testing?
Looking forward to collaborating with you!
Kind Regards
You can go crazy on the dev.mcmerwe.co.za one not the live (mcmerwe.co.za)
Hello,
This is all happening because, in the WooCommerce settings, there’s an option to round numbers to whole numbers — just like in your case: https://monosnap.com/file/h8gUdB0e9MiIcDOQeJTBA5YSdUNNox. In your situation, 5% of 70 is 66.5, and if you multiply that by 19, you get 1263.5 — which rounds up to 1264. This calculation is done by WooCommerce itself.
We replicated the exact same scenario with a default product (without Dynamic Discounts), applied a discount that results in a decimal: https://monosnap.com/file/9yOJdkJYAimKHq2AN0u5a7Jul3Qu0a — and as you can see, WooCommerce calculated it the same way: https://monosnap.com/file/GtWbFGfyhLOgeAlFllIXTn3tFbOFWU.
Kind Regards
Would I need to set “2” in the number of decimals for it to round up?
Hello,
You can try to set 2 or 1 and recheck the issue.
Let me know the result.
Kind Regards