ebon
30
{% if product_card_product.options contains 'Pattern'
or product_card_product.options contains 'Color'
or product_card_product.options contains 'Drawing'
or product_card_product.options contains 'Number'
%}
{%- assign pattern_label = 'pattern,Pattern,color,Color,Colour,colour,Drawing,drawing,number,Number' | split: ',' -%}
{%- for option in product_card_product.options_with_values -%}
{%- assign downcased_option = option.name | downcase -%}
{%- if pattern_label contains downcased_option -%}
{%- assign variant_option = 'option' | append: forloop.index -%}
{%- for value in option.values -%}
{%- for variant in product_card_product.variants -%}
{%- if variant[variant_option] == value -%}
{%- assign handle_value = value | handleize -%}
{% assign prodcard_variant_pattern_values = prodcard_variant_pattern_values | append: handle_value | append: ':' %}
{%- endif -%}
{%- endfor -%}
{% if product_card_product.options contains 'Pattern' or product_card_product.options contains 'Color'%}
{% endif %}
{%- endfor -%}
{%- endif -%}
{% assign prodcard_variant_pattern_values_unique = prodcard_variant_pattern_values | split: ':' | uniq | join: ',' %}
{% assign prodcard_variant_pattern_values_unique = prodcard_variant_pattern_values_unique | split: "," %}
{%- endfor -%}
{%- if prodcard_variant_pattern_values_unique.size > 1 -%}
{{prodcard_variant_pattern_values_unique.size }}
{% if product_card_product.options contains 'Pattern'%}Patterns{% endif %}
{% if product_card_product.options contains 'Number'%}Numbers{% endif %}
{% if product_card_product.options contains 'Drawing'%}Drawings{% endif %}
{% if product_card_product.options contains 'Color'%}Colors{% endif %}
Available
{%- endif -%}
{%- endif -%}