In WooCommerce I can only enter the shipping price excluding tax.
How can I make the given price including tax?
The settings to show ‘prices including tax’ only applies to the products.
So for example if I enter in the settings shipping â¬1,00
It shows on the checkout â¬1,21 (0,21 = tax)
It should be â¬1,00 (incl. 0,21 tax)
(Don’t care about the calculation here, it’s just an example)
Thanks if anybody has a solution or function for this.
A year after the original question I just hit the same problem and there is not a lot out there to help.
On investigation this turns out to be a problem with the shipping tax calculation from “class-wc-tax.php” which as you can see below hard codes shipping to be tax exclusive.
It turns out that for some reason that woo have pushed this assumption of shipping being tax exclusive through their down stream tax calculations so you will need to add a couple of filters to your functions.php in order to fix things.
1) The first to calculate the inclusive tax
Careful that you don’t forget the 10,3 at the end of add_filter. The 10 is the priority which I have left at the default. The 3 is the number of arguments. You really need this one – the filter displays behavioral problems if you leave it out.
2) The second filter is to fix the totals in downstream calculations.
Detail for those that worry that this is real money and real taxes we are talking about
The first filter is fairly straight forward – it simply recalculates the tax in the inclusive case.
The second filter is to deal with woo pushing the assumption of exclusive tax further into their tax calculations.
Around line 1396 of ‘class-wc-cart.php’ we have the following.
What this wants to do is add the shipping tax to the shipping total which we don’t want it to do – and they have hard coded it in……
What we will do is use the conveniently located ‘woocommerce_calculate_totals’ filter() a few lines above around line 1392 to subtract the shipping tax from the total before it all gets added up using the second filter above.
In an earlier cut of this post from a few weeks back I was worried that this would be a can of worms – and it is turning out to be just that now that I can test things.
So huge caveat here. Test your final tax totals and subtotals thoroughly – this is no longer possibly a risk. Woo have made the assumption of tax exclusive shipping and have pushed it through their downstream calculations. Unfortunately you will have to pay tax to your respective governments even if there was a bug in you code.
Remember also when testing that when you change from exclusive to inclusive taxes in woocommerce settings that old prices are not affected, so you may need to use clean test data.
With all that said so far it is looking ok for me, but in my scenario I am bypassing large amounts of woo – I am not using any of their front end code which means I may not have found other places impacted by the assumption of tax exclusive shipping.
A possible alternative solution is to manually adjust the pricing for shipping so it becomes VAT exclusive. I.e. if shipping incl 20% tax is 6 EUR, adjust it to 5 EUR. Note that this only works if your tax rate is the same for all shipping destinations.