Hello. How can i display the total quantity of all products for a customer order?
here is code you can put where you want to make sure the order object access. on that file
{%- for order in customer.orders -%}
{{ order.total_price | money_without_trailing_zeros }}
{%- endfor -%}
Use this code in your customers/order.liquid file.
{% assign total_quantity = 0 %}
{% for line_item in order.line_items %}
{% assign total_quantity = total_quantity | plus:line_item.quantity %}
{% endfor %}
Total Quantity = {{total_quantity}}
1 Like