Remove Products from Order Printer Invoice That Have Zero Quantity

New Member
2 0 2


We are using the Order Printer app for our invoices and packing notes. I changed the layout etc and a few other things, but that's as far as my coding skills go.

Our issue is that when we have refunded for an item, it still shows on the invoice. We thought we could live with it, but today I was playing around with a particular invoice, where we'd done a refund for one item, and then customer wanted to add an item, then changed their mind, so I removed the item.  We don't want the invoice displaying products we've added and then removed. So along with the refunded product the invoice now looks a complete mess!  

Is there any code that I could perhaps state, only display items with quantity more than 1? This would resolve the issue with the refunded items and anything removed.

Any help would be greatly appreciated!


New Member
2 0 1

Same issue here. All invoices are messed up. All shopify stores have this issue its not just us. Whenever a product is removed the storefront account page and the invoices  keep the product in there. It is simply astonishing that such a simple use case has not been addressed. I read somewhere that only if you do some custom implementation with webhooks you can achieve this but no clue.

3 0 2

Hi. In my case, to print invoices without the removed items I changed this line:


{% for line_item in line_items %}


to this:


{% for line_item in fulfilled_line_items %}



Just make sure to print the invoice after fulfillment. Hope this helps

New Member
1 0 1

Had the same issue. I solved it by:

adding " {% if line_item.quantity > 0 %} " after " {% for line_item in line_items %}"

and adding "{% endif %}" after "{% endfor %}"

. All without the quotes.

7 1 0

Thank you nichinu,

That's what I was going to do, but your post confirmed it.

I added it a little differently and it seems to be removing the items with zero (0) quantities properly from the invoice. Here is what my code for the entire table looks like:

<table class="table-tabular" style="margin: 0 0 1.5em 0;">
{% for line_item in line_items %}
{% if line_item.quantity > 0 %}
<td>{{ line_item.quantity }} x</td>
<td>{{ line_item.title }}</td>
<td>{{ line_item.line_price | money }}</td>
{% endif %}
{% endfor %}

Best regards.