How can I combine all tax lines into a single sales tax display?

Topic summary

Main issue: Show a single combined Sales Tax amount in order confirmation emails instead of multiple jurisdiction lines.

What was tried: The OP modified the notification template to sum tax_lines into a variable (assign t = 0; loop over tax_lines; add each line.price; output {{ t | money }}). Saving returned the error “unknown tag ‘t’.”

Suggested solution: Use the built-in total tax variable instead of manual summation: {{ tax_price | money }}. Example provided wraps it in a table row labeled “Taxes,” displaying {{ tax_price | money }}.

Outcome/Status:

  • Practical workaround: Replace the breakdown with {{ tax_price | money }} to show a single total tax value.
  • The original error cause isn’t discussed further, and no alternative loop-based fix is provided.
  • Resolution not explicitly confirmed by the OP, but a clear path to a single-line tax display is available.

Key detail: Code snippets are central—switching to {{ tax_price | money }} simplifies the template and avoids the error.

Summarized with AI on December 30. AI used: gpt-5.

Hello,

I’ve had so many customers complain about the breakdown of sales tax lines, questioning why they’re paying taxes for municipalities they don’t live in, when its because of our physical location we’re shipping from.

I’d like to combine all the tax lines into a single Sales Tax display in our email confirmation. I’ve changed the default notification to the following:

{% assign t = 0 %}
        {% for line in tax_lines %}
          {% t = line.price + t %}
        {% endfor %}
          

  
    

      Sales Tax
    

  
  
    **{{ t | money }}**
  

But i’m getting the error “unknown tag ‘t’” when trying to save. Clearly i’m assigning a variable t, so i’m not sure why its not recognizing this variable. Any tips here?

I use the old tag {{ tax_price | money }} which displays as the tax total.

Taxes

{{ tax_price | money }}