In many countries, shipping cost has to be calculated including the local tax rate. For most products in Germany for example, the tax rate is 19% and therefore shipping has to add 19% of tax to its cost.
WooCommerce automatically adds the tax to the set shipping cost, if set. This is great, as we can’t forget about it.
But if we want to offer a specific price for the customer, no matter how high the tax we need to pay, this can be tricky. WooCommerce always adds the tax to the amount set as shipping cost. If we just enter the shipping price excluding tax, we often end up with rounding mistakes.
Luckily there is an easy trick how to stick with your price: as WooCommerce adds the tax to the cost, we just need to deduct it right before that using the same calcuation.
The basic calculation is:
Shipping cost / 1.Taxrate
If the hipping cost is 3,95€ and the tax rate is 21% this means:
3.95 / 1.21
These calculations can just be added in the shipping cost instead of the usual price.
And voila, customers always pay the price you specify including the right tax.
Hi,
This is not applicable in all cases.
For example, my shipping tax is depending on the products that are bought. Some products (food) have 12% and other 25%. In my case I cant have this rule because it is a fixed shipping rate while I need variable.
Hi Oscar,
this is definitely just a possibility for standard tax cases.
If you have different taxation for different products, you could for example work with shipping classes and then use the same way of calculating the shipping cost.
Hi,
I’ve got a delivery cost of 15 and a tax of 24%, but when i set it to 15/1,24 it gives a delivery cost of 15,12
Any thoughts on why this is?
As I don’t know your whole setup, I can only make guesses. But my first idea would be, that it sounds like a rounding error. Have you tried 15,00 / 1,24 instead of 15/1,24?
Yes, i’ve tried that as well… did not work.
Well, i just have to dig down i all the settings and look for a glitch.
Thanks Anna.
Good luck! Make sure to check that shipping is using a tax rate of 24%. If it were 25% somewhere that would explain the cost of 15,21 during checkout.
Thank you so much. I didn’t see this solution anywhere else, and yet many people were looking for an answer to this issue. This works perfectly. I had no idea I could enter a calculation into that shipping field. Again… Thank you Anna.
Dear Anna,
Is it possible to use a variable instead of a number in the formule? For example VAT (if exists).
Hi Fred, unfortunately, the only variables you can use in the shipping cost are [qty] and [fee]. https://docs.woocommerce.com/document/flat-rate-shipping/#section-2. Everything else would have to be custom coded.
Thanks for your fast reply Anna,
That’s a pity….if that was an option the whole tax question was a little easier. As so many we are offering products in different tax classes. Will stay to our max VAT of 21% and take my losses…..
But if someone is reading this, is it difficult to write a code for it? So find the correct tax class (high or low) and add to a variable VAT.
Cheers,
Fred
Depending on how many products and tax classes you have, maybe you could just give each a different shipping class? So a reduced tax rate item gets shipping class x, and that shipping class is using the calculation with a reduced tax rate.
It’ definitely more manual work for you when setting up the products, but it would give you the possibility to charge the correct tax values.
True Anna, but indeed a lot of work (labour is expensive) :-).
For now I’m using one rate as most of my products are low rate (9%), some exceptions are 21%.
Will try to sort a workable methode as we’re introducing a lot of new products with a high rate….
Always fun with WooCommerce
Have a great weekend.
Fred
An alternative solution to keep shipping prices fixed could be to recalculate them, so that when taxes are added, the final amount is the starting one. This approach might introduce some slight rounding issues, due to the calculations, but it could work with all shipping costs and taxes. I added a comment about it to the original discussion on the WooCommerce Core Github: https://github.com/woocommerce/woocommerce/issues/9320#issuecomment-644262317