Skip to content

Instantly share code, notes, and snippets.

@zakhardage
Last active November 19, 2018 23:52
Show Gist options
  • Save zakhardage/5ff48290a57794d87e455c9da7dab4f3 to your computer and use it in GitHub Desktop.
Save zakhardage/5ff48290a57794d87e455c9da7dab4f3 to your computer and use it in GitHub Desktop.
{% if product.compare_at_price > product.price %}
<del>${{ product.compare_at_price | money_without_currency | ceil }}</del>
<span class="sale-price"><span itemprop="price">${{ product.price | money_without_currency | ceil }}</span> ({{ product.compare_at_price | minus:product.price | times:100 | divided_by:product.compare_at_price }}% off)</span>
{% else %}
<span itemprop="price">${{ product.price | money_without_currency | ceil }}</span>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment