Order Printer - not showing tax percentage in new app

Hi,

I’ve been trying to migrate over my template overs to the new shopify order printer.

i used to have it show 0% or 20% on each item but thats just no longer working, it either all shows 0% or 20%.

currently i have this which was working fine before now it doesn’t

{% for tax_line in line_item.tax_lines %} {{ tax_line.rate | times: 100 }}% {% else %} 0% {% endfor %

any ideaS?

Hello @Chris010101

You can use the below code.

{% for tax_line in line_item.tax_lines %}
{% assign tax_line_rate = tax_line.rate | times: 100 %}
{% if tax_line_rate == 0 %}
    0%
{% else %}
{{ tax_line.rate | times: 100 }}%
{% endif %}
{% endfor %}

If this code does not function as expected, please inform me, as I am eager to assist you.

If the solution presented meets your needs and addresses your query effectively, I encourage you to accept it as the chosen answer. This will acknowledge the support you received and aid fellow community members in identifying reliable and effective solutions for their similar concerns.
Thank you.

Hello , thanks for the help but unfortuantly no, it all shows 20%

Just to note, i’ve gone back to the legacy order printer and its now broken on there as well, so shopify have changed something here

If anyone comes across this thread … as of the 05/06/2024 , this is an issue with Shopify , for some reason it now decides that if any product has tax on in the order all items will show the tax rate.

EDIT - I’ve managed to fix this myself ( for now at least ) without the help of Shopify as the support is generally useless when it comes to this stuff, the workaround is to use tax.price instead of tax.rate. Not ideal as its not really the correct thing to use but it works none the less, basically says if theres no tax price, then there’s no tax so show 0%, otherwise if there is a tax price, then show the rate x 100 i.e 20% for the UK

code is below;

{% for tax_line in line_item.tax_lines %} {% if tax_line.price == 0 %} 0% {% else %} {{ tax_line.rate | times: 100}}% {% endif %} {% endfor %}

Hi Chris, sorry you struggled through this and thanks for posting your solution. For anyone copying this code solution, make sure you don’t copy the line at the beginning, because it’s the opening tag for a table cell - if you don’t close that tag with at some point, it might cause you some issues.