Skip to content

Instantly share code, notes, and snippets.

@baorv
Created June 2, 2020 07:21
Show Gist options
  • Save baorv/9f86e186cf645f7c795dddcfd3119860 to your computer and use it in GitHub Desktop.
Save baorv/9f86e186cf645f7c795dddcfd3119860 to your computer and use it in GitHub Desktop.
discount per item
{% assign discountAllocationAmount = 0 %}
{% for discountAllocation in item.discount_allocations %}
{% assign discountAllocationAmount = discountAllocationAmount | minus: item.amount %}
{% assign discountAllocationAmount = discountAllocationAmount | divide_by: item.quantity %}
{% endfor %}
{{ item.price | minus: discountAllocationAmount }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment