How do I display the total number of items in a customer's order in Order Printer?

I am currently trying to edit my invoice template code in order printer in order to add the total number of items that the customer ordered. I like to use this as a double check on myself when i pull orders to make sure i have pulled the correct total number of total items and avoid accidently shipping incomplete orders especially on large multi item orders that span multiple pages.

Any help would be greatly appreciated on this!

Thanks

Try this

{% assign total_items_count = 0 %} {% for line_item in line_items %} {% assign total_items_count = total_items_count | plus: line_item.quantity %} {% endfor %}
  • Total items {{ total_items_count }}