Skip to content

Instantly share code, notes, and snippets.

@aatronco
Last active March 13, 2020 18:54
Show Gist options
  • Save aatronco/db9ce9dbcf2f0a2b4a2070ca2877ed6e to your computer and use it in GitHub Desktop.
Save aatronco/db9ce9dbcf2f0a2b4a2070ca2877ed6e to your computer and use it in GitHub Desktop.
<!-- Requires adaptation to the Theme -->
<div class="post-prev-text align-center">
{% if product.discount > 0 %}
<strong>{% t "From" %} </strong>{{ product.price | minus:product.discount | price }} <del> {{ product.price | price }}</del>
{% else %}
{% assign variant_prices = product.variants | sort: 'price' | map: 'price' %}
{% if variant_prices.size > 1 %}
<strong>{{ variant_prices | first | price }} - {{ variant_prices | last | price }}</strong>
{%else%}
{{product.price | price}}
{%endif%}
{% endif %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment