Support » Plugin: WooCommerce » How to calculate tax (TVA) after promotion code

  • I have a WordPress website with a WooCommerce shop and sometimes I give promotion codes to clients but I noticed that the promotion code is applied after the taxes.

    I can see that in the PDF Invoices and I don’t know how to fix it.

    EDIT :

    I found that the prices of my products on the shop are with tax.

    I want a way to display the price with tax on the shop but apply promotions on the products without tax, so the tax is applied on the discount product.

    Should I enter the price without tax and then display it with tax in the shop ? Do tax will be applied after promotion in this case ?

    • This topic was modified 1 week, 5 days ago by matt3dtotem.
    • This topic was modified 1 week, 5 days ago by matt3dtotem.
    • This topic was modified 1 week, 5 days ago by matt3dtotem.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Support Three Sons


    Hi @matt3dtotem,

    I ran a quick test on my development site to make sure. When prices are entered without tax, the coupon discount is applied to the pre-tax price of the product. So you could enter prices on your store without tax and then the discounts will be applied to the products before tax is calculated.


    If you have any questions, let me know.



    Ok I will run some tests.

    Thank you for your anwser.



    I have some questions :
    – There is a way to change all the product prices from with tax to without tax all at once ?
    – If I want the customer pay 180€ including tax for a product I have to calculate 180€ – 20% tax and put the result as the price for the product ? For each product ?

    This story of coupon after tax annoys me a lot, I already have a lot of products in my shop and it’s going to be long to calculate each price without tax and to change the price of each product.

    Plugin Support Three Sons


    Hey @matt3dtotem,

    That’s an excellent question. One way to do this all at once is to do a CSV export of your products and then edit the prices in a spreadsheet app. Then import the updated CSV back to change all the prices at once.

    You could use a formula in the spreadsheet to change the prices in bulk too. My wife recently did that to change all the sale prices in her store.

    That’s usually a very good way to make bulk edits.

    You can also use the bulk edit from the products screen. Check the boxes next to the products you’d like to change. Then use the bulk-edit menu above the list to edit the products. You can then adjust the prices of all of these at one time.

    You can also bulk edit products. To do this, go to the Products section in your dashboard. Check the boxes next to the products you’d like to edit and then use the “bulk actions” drop-down at the top to edit these products. There is a field here that will let you adjust the prices of all these products by a percentage or a fixed amount.

    Let me know if you have any questions.

    Can you show me your WooCommerce settings for tax corresponding to the screen of your development site ?

    I have to make some tests and I want to know how you display the tax in the Cart Totals

    Plugin Support Three Sons


    Sure thing. I don’t believe I’ve changed these since I tested this last week.

    tax settings

    Let me know if you have any questions.

    Did you ever test to display prices including tax in shop and during cart ? It works ?
    And did you test to enter price with tax ? The checkout is the same as your first screen ?

    Plugin Support Three Sons


    I set my store to show prices including tax both in the shop and the cart. Prices are entered including tax. I created a new product that costs $4000 and set a tax rate of 10%. At checkout, here’s how this looks with a 10% discount coupon.

    discount in cart

    It appears that the discount is being applied before taxes. The final price ended up being $3,600 which gives a VAT of $327.27.

    The tax without the discount would be $363.64. So does appear that the discount is being applied before the tax is calculated.

    I don’t really understand.

    If I resume :
    Tax : 10%
    Coupon : 10%
    Product price : 4000$

    If you applied coupon before tax it will be :
    4000 – 10% = 4000 – 400 = 3600$
    Then apply tax :
    3600 + 10% = 3600 + 360 = 3960

    If you applied coupon after tax :
    4000 + 10 % = 4000 + 400 = 4400$
    Then apply coupon :
    4400 – 10% = 4400 – 440 = 3960$

    It’s the same right ?

    Does the tax of 10% is already applied in the 4000$ product or not ?

    Plugin Support Three Sons


    Thanks for posting this. Calculating tax for prices entered including tax is a bit different. Take the $4000 item example.

    The cost of the item with a 10% tax isn’t $3,600 because the overall total already includes tax. To find the cost of the item we’ll need to determine what the tax is. Here’s a formula for that.

    Tax = Line Price - Line Price / 1.X

    Where X is the tax rate.

    In this case, it would be like this:

    Tax = 4000 – (4000/1.1)

    Tax = $363.64

    Item = $3636.36

    There are online calculators that can do this for you too:

    Here’s some additional documentation on calculating tax for products that include taxes in prices.

    Take a look at that and see how this breaks down for you. If you run into trouble, please let me know.

    Oh ok it depends on whether or not you include the tax or not. Thank you, I will run some tests with this.

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.