Forked from holdinghandsfeedingducks/price-sale.liquid
Last active
July 18, 2017 04:12
-
-
Save nrkn/11c3c99e988ed2c87c6a77020c5a7b3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign saved_amount = compare_price | minus: product_price %} | |
{% comment %} | |
Unless this store uses multiple currencies, | |
we will remove the decimals when they are equal to 00, | |
or when the amount is > 10 (dollars, pounds, etc.). | |
{% endcomment %} | |
<!-- using expected price-sale template --> | |
{% if shop.money_format contains 'money' %} | |
{% assign saved_amount = saved_amount | money %} | |
{% else %} | |
{% assign saved_amount = saved_amount | money_without_trailing_zeros %} | |
{% endif %} | |
{{ 'products.general.save_html' | t: saved_amount: saved_amount }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment