I have a discount code on a Magento store that reduces the cost of the purchase by 10%. All works ok in that respect, except for the tax calculation.


Total value of the order is £34.18 Discount to be applied is 10% - £3.42

Therefore the new subtotal is £30.76

If we divide 30.76/1.2 and minus this figure from 30.76, i get the tax amount, which is £5.13.

That is exactly what i want. However, the options in the back of Magento change things dramatically, to the point where the tax is no longer correct, or the total is no longer correct.

If my settings are:

Apply Customer Tax: After Discount Apply Discount On Prices: Including Tax

My figures are: Total value of the order is £34.18 Discount: 10% = £3.42 (Correct) (New subtotal is £30.76) Tax: £5.01 (Incorrect) Total: £30.07 (Incorrect) (Difference of 69p, which is 20% of the discount amount).

What it appears it is doing is taking tax off of the total order and the tax off of the discount also. (Tax calculation is set to be based on the total).

Other settings:

Apply Customer Tax: After Discount Apply Discount On Prices: Excluding Tax

This is the only setting where the tax is calculated properly and correct, however, the discount on the front end is shown incorrect (showing excluding tax).

Apply Customer Tax: Before Discount Apply Discount On Prices: Including Tax

Tax is incorrect and displays as £5.70

So, am i missing something really simply, or is it a lot harder than this and certain files will need to be edited to get what i want? Magento is my version, and i have been back and forth through the settings time and time again.

1 Answer 1


Stumbled across this whilst trying to find a solution to a similar issue. Anyway, I resolved my problem and this seemed like the most relevant place to share my solution. Hopefully it will help yourself or someone in a similar Mage 'tax boat':

Example - Cart subtotal w/o tax £100

My Cart discount promotion was 30% discount.

£100 - 30% = £70

Customer tax was added after @ 20%

£70 + 20% = £84


What I actually ended up with was a total of £82.60

I expected Magento to handle it as you have described, however my tax was down 10% of what it should have been? I fixed this behaviour as follows:

Setting > Configuration > Sales > Tax > Calculation Settings

Apply Customer Tax: After Discount

Apply Discount On Prices: Excluding Tax

Apply Tax On: Custom price if available

enter image description here

  • 1
    Life saver. Was struggling with the discount being calculated before applying taxes. It's the "Apply Discount On Prices" setting that should be changed to "Including Tax".
    – Jurgen
    Commented Oct 4, 2017 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.