Last active
August 28, 2020 01:17
-
-
Save dylanjhunt/2a8438b5dca61075d294131b55b46681 to your computer and use it in GitHub Desktop.
Filter by size in stock Shopify step 2
This file contains hidden or 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
{% assign sizes = '' %} | |
{% assign outofstock = false %} | |
{% for tag in current_tags %} | |
{% if tag == 'XS' or tag == 'S' or tag == 'M' or tag == 'L' or tag == 'XL' %} | |
{% assign outofstock = true %} | |
{% endif %} | |
{% endfor %} | |
{% for variant in product.variants %} | |
{% if variant.available %} | |
{% assign sizes = sizes | append: variant.options[1] | append: ' ' %} | |
{% if current_tags contains variant.options[1] %} | |
{% assign outofstock = false %} | |
{% endif %} | |
{% endif %} | |
{% endfor %} | |
{% if outofstock == false %} | |
<!-- INSERT THE PRODUCT GRID HERE --> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment