Woocommerce TAX calculation/rounding
-
Hello,
I’ve been struggling with the following problem:
I have a product in woocommerce that has a price of 557.98 and a tax of 19%
And in woocommerce settings I have “prices do not include taxes”.
I also have a coupon of 30% discount.When I create an order with the product mentioned above I get the following result.
Sub-total : 1,673.94 (product quantity is 3)
Coupon : – 502.18
Tax 19%: 222.63
Total: 1,394.39My problem is with the tax calculation when I am trying to extract woocommerce data and recalculate the total I get the following total 1,394.40.
Product | Product*Quantity | Tax 19%
557.98 | 1673.94 | 318.05
Discount 30%
167.39 | -502.18 | -95.41
Sum of the 2 above
Total | 1171.76 | 222.64 => 1,394.40So at first, I thought that the tax is calculated from the subtotal so 19% of 1171.76 would be 222.63 and not the sum of the order items tax. It would make sense.
I played around with the woocommerce->settings->tax rounding option. But I got the same result => 222.63
So I tried testing some more this time with multiple taxes.
This time I created an order with 2 products:
Product 1 | Price: 50.12 | Quantity: 3 | Tax:5%
Product 2 | Price: 557.98 | Quantity: 3 | Tax:19%
And a discount coupon of 30%
I also tested with and without rounding and got the following results:
Sub-total: 1,824.31
Coupon: -547.29
Tax 5%: 5.26
Tax 19%: 222.63
Total: 1,504.91With rounding on.
Sub-total: 1,824.31 (how did it get to this number? shouldn’t it be 1,824.30? )
Coupon: – 547.29
Tax 5%: 5.26
Tax 19%: 222.63
Total: 1,504.92 (how did it get to this number ?????)I also got this when rounding was on but I could not reproduce this again after that =/. I assume this was an error. But then how would I know when a rounding error happens?
Sub-total : 1,824.31
Coupon: – 547.28 (how did it get to this number ?????)
Tax 5%: 5.26
Tax 19%: 222.64 (how did it get to this number ?????)
Total: 1,504.93These tests were made with Woocommerce 6.9.1 and WordPress 6.0.2
What I would like to know is if it is possible to configure woocommerce so that in the first case I would get a tax of 222.64 (just using woocommerce settings). And if it is, how would I configure that?
And in the second cases, if anyone can provide any clarifications for why or how those totals got to those numbers or maybe some advice on how can someone troubleshoot this without losing his mind, I would be grateful.
Thank you, If you need more information please tell me.
- The topic ‘Woocommerce TAX calculation/rounding’ is closed to new replies.