{%- capture label_html -%} {%- assign label_count = 0 -%} {%- if product.metafields.theme.label != blank -%} {%- assign label_count = label_count | plus: 1 -%} {{ 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 -%} {%- assign label_count = label_count | plus: 1 -%} {{ new_label_text }} {%- endif -%} {%- liquid assign cheapest_variant_price = cheapest_variant.price assign cheapest_variant_compare_at_price = cheapest_variant.compare_at_price if cheapest_variant.metafields.app--168074346497.discount_type.value != nil and cheapest_variant.metafields.app--168074346497.discount_type.value != "fixed" assign deducted_percentage = 1.0 | minus: product.metafields.app--168074346497.discount_percentage.value if cheapest_variant.metafields.app--168074346497.discount_percentage.value > 0.01 assign deducted_percentage = 1.0 | minus: cheapest_variant.metafields.app--168074346497.discount_percentage.value endif assign cheapest_variant_price = cheapest_variant.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil assign cheapest_variant_compare_at_price = cheapest_variant.price if cheapest_variant.compare_at_price > cheapest_variant_compare_at_price assign cheapest_variant_compare_at_price = cheapest_variant.compare_at_price endif endif if label_count < 2 and settings.prod_reduction_show and cheapest_variant_compare_at_price > cheapest_variant_price if settings.prod_reduction_type == 'percent' assign amount = 1.0 | times: cheapest_variant_price | divided_by: cheapest_variant_compare_at_price assign amount = 1.0 | minus: amount assign amount = amount | times: 100.0 | round assign sale_label_text = 'products.product.percent_reduction' | t: amount: amount else assign amount = cheapest_variant_compare_at_price | minus: cheapest_variant_price | money assign sale_label_text = 'products.product.value_reduction_html' | t: amount: amount endif assign label_count = label_count | plus: 1 endif -%} {%- if sale_label_text -%} {{ sale_label_text }} {%- endif -%} {%- if label_count < 2 and settings.prod_stock_warn_show and settings.prod_stock_warn_limit_int == 0 and product.variants.size == 1 and product.variants.first.inventory_management != blank and product.variants.first.inventory_quantity > 0 -%} {%- assign label_count = label_count | plus: 1 -%} {{ 'products.inventory.only_x_left' | t: quantity: product.variants.first.inventory_quantity }} {%- elsif label_count < 2 and settings.prod_stock_warn_show and product.variants.size == 1 and product.variants.first.inventory_management != blank and product.variants.first.inventory_quantity > 0 and product.variants.first.inventory_quantity <= settings.prod_stock_warn_limit_int -%} {%- assign label_count = label_count | plus: 1 -%} {{ 'products.inventory.only_x_left' | t: quantity: product.variants.first.inventory_quantity }} {%- endif -%} {%- endcapture -%} {%- if label_html != blank -%}
{{- label_html -}}
{%- endif -%}