1

Now that all prices are including tax when the option 'included in price' is set in the settings menu, we appear to have multiple tags for prices inclusive of tax to use in templates inside the {exp:store:product} pair, but none to show the ex-tax price or even the current tax amount to run a quick php calculation.

For example, we can use any of the following to show the price:

{price_inc_tax} // deprecated in 2.0
{regular_price}
{price}
{price_val}

...but as far as I can see, there are no tags for _ex_tax or tax_val until the user gets to the checkout stage.

There surely must be the ability to show the price excluding tax now that prices are entered inclusive of tax?

Is the user option:

A - add prices ex tax and have the facility to display prices _inc_tax OR B - add prices inc tax and lose the option to display prices _ex_tax

1

Your choice is basically:

(a) Enter prices ex-tax in the CP, and display them ex-tax on your front end, or

(b) Enter prices inc-tax in the CP, and display them inc-tax on your front end

Therefore, if you want to display prices ex-tax on your front end, you should enter them ex-tax in the CP, and uncheck the "included in price" option for your tax rate.

The reason for this is that in your situation, if prices are entered inclusive of tax, there really is no tax-exclusive price for an individual item until it is added to the cart. If you did try to display this, you would only confuse customers with the tax rounding issues we faced in Store 1.

For example, say your product is $10 including tax, with a 15% tax rate. If you were to calculate the ex-tax price of this product, you would say:

$10 / 1.15 = 8.695652174 = $8.70 rounded to 2dp

So you cleverly display the price as $8.70 to the user. Then they add 10 items to their cart, thinking the total should be:

$8.70 * 10 = $87.00

But when you use tax-inclusive pricing, the price that is added to the cart is the price including tax. So behind the scenes, Store does:

$10 * 10 = $100.00 (including tax)

To display the total tax for the order, Store then calculates the tax on the total:

$100 - ($100.00 / 1.15) = 13.043478261 = $13.04 tax
$100 - $13.04 = $86.96 excluding tax

If you were trying to be clever and display tax-exclusive prices when you entered them inclusive of tax in the CP, your customer would see:

$8.70 * 10 = $86.96 <-- whoa! where did my 4c go?!

Now, if you really wanted to display tax-exclusive prices in the first place, then you should enter them exclusive of tax in the CP. That will cause Store to calculate tax in the other direction. For example, if your product cost $8.70 with 10% tax:

$8.70 * 10 = $87.00 excluding tax
$87.00 * 0.15 = $13.05 tax
$87.00 + 13.05 = $100.05 including tax

Hopefully this gives you some insight into the perils of converting between tax-inclusive and tax-exclusive pricing. Basically, by entering prices in the CP the way you want to display them on your site's front end, you allow Store to perform the correct calculations and avoid confusing any of your customers by displaying incorrect calculations.

Either way, Store 2 doesn't calculate the total tax on an order until after it has taken into account the item quantity, so it is wrong to try and back-calculate or display the tax-exclusive price if your customers will be charged based on the tax-inclusive price, or vice versa.

| improve this answer | |
  • Thanks for the full answer Adrian, appreciate tax rounding is a complicated beast and there isn't a 1 size fits all. – Jamie Taylor Jan 10 '14 at 13:50
  • No problem. In every country/jurisdiction we've seen so far, tax can be calculated on a per-line item level like this (and most accounting packages operate the same way). If your accountant says otherwise though, I'd love to hear about it. Just send us an email support@exp-resso.com :-) – Adrian Macneil Jan 10 '14 at 22:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.