{%- capture all_variants_label_html -%} {%- if product.metafields.theme.label != blank -%} {{ product.metafields.theme.label | escape }} {%- endif -%} {%- liquid if settings.prod_new_show if settings.prod_new_method == 'date' assign now_s = 'now' | date: '%s' | plus: 0 assign pub_s = product.created_at | date: '%s' | plus: 0 assign diff_days = now_s | minus: pub_s | divided_by: 86400 if diff_days < settings.prod_new_limit_int assign new_label_text = 'products.product.new' | t endif elsif settings.prod_new_method == 'tag' if product.tags contains 'New' or product.tags contains 'new' assign new_label_text = 'products.product.new' | t endif else for collection in product.collections assign split_collection_handle = collection.handle | split: '-' if split_collection_handle contains 'new' assign new_label_text = 'products.product.new' | t break endif endfor endif endif -%} {%- if new_label_text -%} {{ new_label_text }} {%- endif -%} {%- endcapture -%} {%- for variant in product.variants -%} {%- if current_variant and variant.id == current_variant.id and label_html -%}
{{- label_html -}}
{%- endif -%} {%- endfor -%} {%- if current_variant == false and all_variants_label_html != blank -%}
{{- all_variants_label_html -}}
{%- endif -%}