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
{% for option in product.options %} | |
{% if option contains "Color" %} | |
{% assign optionName = "option" | append: forloop.index %} | |
{% assign colors = product.variants | map: optionName %} | |
{% assign colorsFiltered = '' %} | |
{% for colorOption in colors %} | |
{% unless colorsFiltered contains colorOption %} | |
{% assign colorsFiltered = colorsFiltered | append: ', ' | append: colorOption %} | |
{% endunless %} | |
{% endfor %} |
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 total = product.variants | map: 'available' | join: ", " | remove: 'false, ' %} | |
{% assign available = total | split: ',' %} | |
{{ available.size }} of {{ product.variants.size }} left |
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
{% if product.options.size == 1 %} | |
{% for variant in product.variants %} | |
{% unless variant.available %} | |
jQuery('.single-option-selector option:contains(' + {{ variant.title | json }} +')').remove(); | |
{% endunless %} | |
{% endfor %} | |
jQuery('.single-option-selector').trigger('change'); | |
{% endif %} |
NewerOlder