I’ve read through this thread and also the https://github.com/woothemes/woocommerce/wiki/How-Taxes-Work-in-WooCommerce Wiki entry. And it makes perfectly sense to me.
However, this issue is not about tax calculation but about when to round. And I have to admit that @scheichmanfred is right.
Let’s assume I have a shop that has stored all the product prices incl. taxes.
Furthermore, let’s assume I display the prices without taxes on all pages and also in the checkout process.
Now this works fine for single items. But whenever I add more than one of a kind to the cart, we might get a problem, because prices are not rounded at the time they are supposed be.
Let’s imagine the following situation:
Product #1
Stored price incl. tax: 25,00
Tax rate: 20% (=0.2)
Calculated price excl. tax: 20,83 (=25/1,2=20,833333333)
Displayed single unit price: 20,83
Everything fine so far, right?
But now let’s look at the calculation when we add multiple units to a cart.
4 x Product #1
Expected total price excl. tax: 83,32 (=4*20,83)
Displayed total price in cart excl. tax: 83,33 (=4*20,83333333333)
The cart now shows the single unit price correctly as rounded 20,83.
But the total price will be shown as 83,33, which is not correct in this context, since the rounded single unit price is indeed 20,83 and not 20,83333333333.
As a result, the cart will always display a wrong amount for multi unit items, since rounding doesn’t take place before multiplying the single price.
So, to correct this situation, we could either show the single price the calculation is based on (20,83333333333) or we could simply round the single unit price before multiplying it by the number of units.
Do you still think this is not a problem @icaleb?
Let me know if my thoughts are not correct and there already is a way to fix this issue.