Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!-- 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
You can’t perform that action at this time.