1

Because we're still on EE 2.7.3, I'm using 2.2.0 of EXP:Store, and I'm running into a problem with itemised taxes.

We have items at 2 tax rates, 6% and 21%, separated into categories (and as luck would have it, there's only 1 6% category while there are 15+ 21% cats).

When I need to itemise each item's tax in the checkout list:

<td>{item_tax} ({tax_percent}%)</td>

Seems simple, except that while the first tag renders the correct tax, the second doesn't give the correct rate. I'm clearly missing something...

2
  • What's the value of tax_percent? Is it always one and not the other (6% or 21%)?
    – Ian Young
    Apr 4, 2014 at 7:52
  • It tends to be the lower of the two values in the label (6%) in the label field, but the correct value is calculated in the actual tax_item value
    – Holland
    Apr 7, 2014 at 9:53

1 Answer 1

1

When you are using multiple tax rates, you need to use the {adjustments} loop to display each of them individually. The {order_tax} and {item_tax} variables will only display aggregate taxes so aren't suitable for dealing with multiple taxes.

"Adjustments" in Store are basically extra line items which are not real products (for example: discounts, shipping, and taxes). Each order can have many adjustments to the order total. See the checkout tag adjustments documentation for more information.

You can loop through the adjustments and display totals for each tax rate in the checkout or order tags like this:

{adjustments}
    {if adjustment:type == "tax"}
        {adjustment:name} ({adjustment:percent}%): {adjustment:amount} 
    {/if}
{/adjustments}
4
  • Sorry for the delay - I've been traveling for a few days (vacation, really) and it seems I've not been using adjustments correctly. Or at least it seems that way after trying your tests with 3 Long Island ice teas in me. My goal is to have each line item reflecting the correct individual price, tax and shipping cost - I've got to explore it a it, but I missed this in the online manual. Thanks..
    – Holland
    Apr 7, 2014 at 10:33
  • Fair enough :) The {item_tax} variable should be correct on a per-line item basis. There is no such per-line item tax percentage variable, only {tax_percent} which is global to the order. There is also no such thing as per-line item shipping costs, the shipping costs are calculated across the whole order. Apr 7, 2014 at 10:43
  • On thing - how do I use this with a {items} loop, like on the checkout.html example page. Putting it inside the loop seems to give me duplicate results (2 items, 2 duplicates, 3 items, 3 duplicates, etc). I'm trying to show in-line: count - item desc - item tax - item price
    – Holland
    Apr 15, 2014 at 4:35
  • The {adjustments} loop is per-order, not per-item, so you can't use it inside the {items} loop. As I mentioned, {item_tax} is the only variable you can use inside the {items} loop. Apr 15, 2014 at 11:20

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.