Skip to content

Instantly share code, notes, and snippets.

@kyleaparker
Created January 10, 2014 20:47
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 kyleaparker/8362253 to your computer and use it in GitHub Desktop.
Save kyleaparker/8362253 to your computer and use it in GitHub Desktop.
Shopify: Show the second lowest variant price
{% assign lowestPrice = product.variants.first.price %}
{% assign secondPrice = 0 %}
{% for variant in product.variants %}
{% if variant.price < lowestPrice %}
{% assign secondPrice = lowestPrice %}
{% assign lowestPrice = variant.price %}
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment