Splitting tax line in customer Order Notification into 8% and 10% tax rates

Topic summary

A user needs to modify their customer order confirmation email to display taxes split by rate (8% and 10%) instead of showing a single combined tax total. This breakdown is legally required in Japan as of October 1st.

Current situation:

  • The default email template shows only one line for total taxes (税金合計)
  • The existing code displays a single subtotal-line for all taxes combined

Attempted solution:

  • The user added code attempting to loop through tax lines and display them separately based on tax rate (0.08 and 0.10)
  • The code assigns order.tax_lines and uses conditional logic to show “税金(8%)” and “税金(10%)” with their respective amounts

Current problem:

  • The taxes appear on the top line after adding the code
  • The JPY values don’t display the same as the lines below
  • The implementation isn’t working as expected

The user is seeking guidance on what code modifications are needed and where to properly place them in the email template to achieve the required tax breakdown display.

Summarized with AI on November 16. AI used: claude-sonnet-4-5-20250929.

In the Order confirmation email sent to customers, our default email shows just one line for total taxes that the customer pays. I would like to have it split into the total for 8% taxes, and the total for 10% taxes. What kind of code would I need to put in the email, and where should I replace?

(FYI, showing taxes by 8% and 10% is required by law in Japan as of October 1st)

The current code is:

税金合計

I added this code immediately after the above code, but the taxes show up on the top line, and the JPY value does not have the same look as the below lines. (see attached image)

Added code:

{% assign tax_lines = order.tax_lines %}

{% for tax_line in tax_lines %} {% if tax_line.rate == 0.08 %}

税金(8%) {{ tax_line.price | money_with_currency }}

{% endif %} {% if tax_line.rate == 0.10 %}

税金(10%) {{ tax_line.price | money_with_currency }}

{% endif %} {% endfor %}