Don Morphy Sale

{% assign dm_coll = collections['sale'] %}
Sort — by size

{% if dm_coll and dm_coll.products.size > 0 %}
{% for product in dm_coll.products %} {% assign has_stock = false %} {% for v in product.variants %}{% if v.available %}{% assign has_stock = true %}{% endif %}{% endfor %} {% if has_stock %} {% assign title = product.title | remove_first: 'Don Morphy ' %} {% assign size_index = nil %} {% for opt_name in product.options %}{% assign opt_down = opt_name | downcase %}{% if opt_down contains 'size' %}{% assign size_index = forloop.index0 %}{% endif %}{% endfor %} {% assign sizes = ',' %} {% assign size_text = '' %} {% assign low = nil %} {% assign was = nil %} {% for v in product.variants %} {% if v.available %} {% if low == nil or v.price < low %}{% assign low = v.price %}{% endif %} {% if v.compare_at_price > v.price %} {% if was == nil or v.compare_at_price > was %}{% assign was = v.compare_at_price %}{% endif %} {% endif %} {% if size_index != nil %} {% assign s = v.options[size_index] %} {% assign needle = ',' | append: s | append: ',' %} {% unless sizes contains needle %} {% assign sizes = sizes | append: s | append: ',' %} {% if size_text != '' %}{% assign size_text = size_text | append: ' · ' %}{% endif %} {% assign size_text = size_text | append: s %} {% endunless %} {% endif %} {% endif %} {% endfor %}
{% if product.featured_image %} {{ title | escape }} {% endif %} {% if was %}Sale{% endif %}

{{ title | escape }}

{% if low and low > 0 %}

{% if was %}{{ was | money }}{% endif %}{{ low | money }}

{% endif %}

{% if size_text == '' %}One size{% else %}{{ size_text }}{% endif %}

{% endif %} {% endfor %}
{% else %}

No products found in the SALE collection.

{% endif %}