Skip to content

Instantly share code, notes, and snippets.

@tobiasdalhof
Last active June 8, 2022 21:49
Show Gist options
  • Save tobiasdalhof/93bc71eb1cd431aca246217092d96d0f to your computer and use it in GitHub Desktop.
Save tobiasdalhof/93bc71eb1cd431aca246217092d96d0f to your computer and use it in GitHub Desktop.
Shopify customer total spent value for all orders with status "paid", "partially_paid" and "partially_refunded" without refundend amount | ✨ Estimated delivery date & order deadline for product pages https://www.delm.io
{% assign total_spent = 0 %}
{% for order in customer.orders %}
{% if order.financial_status == 'paid' or order.financial_status == 'partially_paid' or order.financial_status == 'partially_refunded' %}
{% assign total_spent = total_spent | plus: order.total_price | minus: order.total_refunded_amount %}
{% endif %}
{% endfor %}
{{ total_spent | money }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment