Skip to content

Instantly share code, notes, and snippets.

@katyayu
Created October 13, 2017 13:59
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save katyayu/7b09512bd85b5d2a2e5f15c4e070b439 to your computer and use it in GitHub Desktop.
{% if settings.badge_toggle %}
{% if settings.new_products_period.size > 0 %}
{% if dates_diff <= new_products_period %}
<span class="product_badge new">{{ 'layout.product.new_products' | t }}</span>
{% endif %}
{% endif %}
{% if on_sale %}
{% if settings.sale_type == "text" %}
<span class="product_badge sale">{{ 'layout.product.sale' | t }}</span>
{% else %}
<span class="product_badge sale">–{{ product.compare_at_price_max | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_max | money_without_currency | times: 100 | remove: '.0' }}%</span>
{% endif %}
{% endif %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment