Skip to content

Instantly share code, notes, and snippets.

@walkirien
Created September 23, 2019 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walkirien/966be608ab76c2b67766db2eab3fd053 to your computer and use it in GitHub Desktop.
Save walkirien/966be608ab76c2b67766db2eab3fd053 to your computer and use it in GitHub Desktop.
{%assign min_price = product.price %}
{%assign max_price = product.price %}
{% for variant in product.variants %}
{% if max_price < variant.price %}
{%assign max_price = variant.price %}
{% endif %}
{% if min_price > variant.price %}
{%assign min_price = variant.price %}
{% endif %}
{%endfor%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment