Created
February 5, 2018 18:27
-
-
Save essmahr/cbe9ab1af4b3347e7f4bd6dec16c43e1 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
{% unless grid_item_width %} | |
{% assign grid_item_width = 'large--one-third medium--one-half' %} | |
{% endunless %} | |
{% include 'buyx-price-min' with product %} | |
{% assign on_sale = false %} | |
{% if product.compare_at_price > buyx_price_min %} | |
{% assign on_sale = true %} | |
{% endif %} | |
{% assign sold_out = true %} | |
{% if buyx_product_available %} | |
{% assign sold_out = false %} | |
{% endif %} | |
<div class="grid__item grid-product {{ grid_item_width }}{% if sold_out %} is-sold-out{% endif %}"> | |
<div class="grid-product__wrapper"> | |
<div class="grid-product__image-wrapper"> | |
<a class="grid-product__image-link" href="{{ product.url | within: collection }}"> | |
<img src="{{ product | img_url: 'large' }}" alt="{{ product.featured_image.alt | escape }}" class="grid-product__image"> | |
</a> | |
{% if sold_out %} | |
<div class="grid-product__sold-out"> | |
<p>{{ 'products.product.sold_out_html' | t }}</p> | |
</div> | |
{% elsif on_sale %} | |
<div class="grid-product__on-sale"> | |
{% capture saved_amount %}{{ product.compare_at_price | minus: buyx_price_min | money }}{% endcapture %} | |
{% capture saved_amount %}{{ product.compare_at_price | minus: buyx_price_min | times: 100 | divided_by: product.compare_at_price }}{% endcapture %} | |
<p>{{ 'products.general.save_html' | t: saved_amount: saved_amount }}</p> | |
</div> | |
{% endif %} | |
</div> | |
<a href="{{ product.url | within: collection }}" class="grid-product__meta"> | |
<span class="grid-product__title">{{ product.title }}</span> | |
<span class="grid-product__price-wrap"> | |
<span class="long-dash">—</span> | |
<span class="grid-product__price"> | |
{% if product.price_max > buyx_price_min %} | |
{{ buyx_price_min | money_without_trailing_zeros }} | |
<span class="icon-fallback-text"> | |
<span class="icon icon-plus grid-product__price-min" aria-hidden="true"></span> | |
<span class="fallback-text">+</span> | |
</span> | |
{% else %} | |
{% if on_sale %} | |
{{ buyx_price_min | money_without_trailing_zeros }} <span style="color: #99999b">({{ product.compare_at_price | money_without_trailing_zeros }})</span> | |
{% else %} | |
{{ buyx_price_min | money_without_trailing_zeros }} | |
{% endif %} | |
{% endif %} | |
</span> | |
</span> | |
{% if settings.product_vendor_enable %} | |
<p class="grid-product__vendor">{{ product.vendor }}</p> | |
{% endif %} | |
</a> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment