Skip to content

Instantly share code, notes, and snippets.

@Dimls
Created February 16, 2018 19:09
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 Dimls/b5accbecc398e831af352fbfc2140c8b to your computer and use it in GitHub Desktop.
Save Dimls/b5accbecc398e831af352fbfc2140c8b to your computer and use it in GitHub Desktop.
<!-- snippets/card-price-mobile.liquid -->
<a href="{{ item.url | within: collection }}" class="product-grid-card-link">
<div class="mobile-price-container">
<p class="h2 product-title">
<a href="{{ item.url | within: collection }}">{{ item.title | truncate:25 }}</a>
</p>
{% if on_sale %}
{% if item.price_varies %}
{% assign sale_price = item.price | money_without_trailing_zeros %}
<p class="h3 product-price product-on-sale">{{ 'products.product.on_sale_from_html' | t: price: sale_price }}</p>
{% else %}
<p class="h3 product-price">{{ item.price | money_without_trailing_zeros }}</p>
{% endif %}
{% else %}
{% if item.price_varies %}
{% assign price = item.price | money %}
<p class="h3 product-price">
{% if sold_out %}
<s>{{ 'products.general.from_text_html' | t: price: price }}</s>
{%else%}
{{ 'products.general.from_text_html' | t: price: price }}
{%endif%}
</p>
{% else %}
<p class="h3 product-price">
{% if sold_out %}
<s>{{ item.price | money_without_trailing_zeros }}</s>
{%else%}
{{ item.price | money_without_trailing_zeros }}
{%endif%}
</p>
{% endif %}
{% endif %}
</div>
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment