{% comment %}theme-check-disable ImgLazyLoading{% endcomment %}
{%- liquid
assign container = 'li'
assign placeholder_int = placeholder_int | default: 1
assign width_class = width_class | default: ''
assign sizes = sizes | default: false
assign slider = slider | default: false
assign type = type | default: 'grid'
assign no_lazyload = no_lazyload | default: false
assign enable_image_choice = enable_image_choice | default: false
assign img_view = img_view | default: 'first'
if fill_images == null
assign fill_images = settings.fill_product_images
endif
if quick_buy_compact == null
assign quick_buy_compact = false
endif
if enable_quick_buy_drawer == null
if settings.layout_productcard == 'quickshop'
assign enable_quick_buy_drawer = true
else
assign enable_quick_buy_drawer = false
endif
endif
if enable_quick_buy_desktop == null
assign enable_quick_buy_desktop = true
endif
if enable_quick_buy_mobile == null
assign enable_quick_buy_mobile = true
endif
if enable_quick_buy_qty_selector == null
assign enable_quick_buy_qty_selector = false
endif
if enable_variant_picker == null
assign enable_variant_picker = true
endif
if enable_color_picker == null
assign enable_color_picker = settings.show_color_swatches
endif
if show_image == null
assign show_image = true
assign show_labels = true
assign show_title = true
assign show_price = true
assign show_stock = true
assign show_vendor = settings.show_vendor
assign show_rating = settings.show_product_rating
endif
if layout == 'list-compact'
assign show_labels = false
assign show_stock = false
assign show_vendor = false
assign show_rating = false
endif
if layout == 'hotspot'
assign show_labels = false
assign show_image = false
assign container = 'div'
if product.variants.size > 1 or product.available == false
assign enable_quick_buy_drawer = true
endif
endif
assign current_variant = product.selected_or_first_available_variant
if custom_height_ratio == null
assign custom_height_ratio = settings.custom_product_image_ratio
endif
assign custom_height_ratio = custom_height_ratio | divided_by: 100.0
assign image_width = 430
assign image_height = image_width | times: custom_height_ratio | round
assign image_width_2 = image_width | times: 1.5
assign image_height_2 = image_height | times: 1.5
assign image_width_small = image_width | divided_by: 3
assign image_height_small = image_height | divided_by: 3
if product == blank
assign vendor = 'Vendor name'
assign title = 'Product title'
assign price = 0 | money
else
assign vendor = product.vendor
if vendor == 'vendor-unknown' or vendor == shop.name
assign show_vendor = false
endif
assign title = product.title
if layout == 'list-compact'
assign price = current_variant.price | money
else
assign price = product.price | money
endif
endif
assign total_stock = 0
for variant in product.variants
if variant.matched and variant.inventory_quantity > 0
assign total_stock = total_stock | plus: variant.inventory_quantity
endif
endfor
if total_stock <= 0
assign total_stock = current_variant.inventory_quantity
endif
if total_stock <= 0 and current_variant.inventory_management != null and current_variant.inventory_policy == 'continue' and current_variant.available and current_variant.inventory_quantity <= 0 and settings.preorder
assign preorder = true
unless settings.show_preorder_inventory
assign show_stock = false
endunless
endif
assign static_color_picker = false
if settings.layout_productcard == 'variant_picker' or settings.layout_productcard == 'quickshop' or settings.layout_productcard == 'add_to_cart'
assign static_color_picker = true
elsif settings.color_swatch_behavior == 'static' and settings.layout_productcard == 'standard'
assign static_color_picker = true
endif
assign overlay_static = false
if settings.quickshop_behavior == 'static'
if settings.layout_productcard == 'quickshop' or settings.layout_productcard == 'add_to_cart'
assign overlay_static = true
endif
elsif settings.color_swatch_behavior == 'static' and settings.layout_productcard == 'standard'
assign overlay_static = true
endif
assign collection_page = false
if origin == 'collection' or origin == 'search'
assign collection_page = true
endif
assign quickshop = false
if settings.layout_productcard == 'quickshop'
assign quickshop = true
elsif settings.layout_productcard != 'standard'
if layout == 'list' or layout == 'hotspot' or layout == 'grid'
assign quickshop = true
endif
endif
assign fixed_text_alignment_left = false
if layout == 'list'
assign fixed_text_alignment_left = true
endif
assign color_triggers = settings.color_swatch_name | newline_to_br | strip_newlines | replace: '
', '|' | split: '|'
assign color_option = false
if enable_color_picker
if settings.enable_color_swatches
for option in product.options_with_values
if color_triggers contains option.name
assign color_option = option
break
endif
endfor
endif
assign colors_size = color_option.values | size
if settings.color_swatches_single and colors_size < 2
assign color_option = false
endif
endif
assign size_triggers = settings.variant_picker_name | newline_to_br | strip_newlines | replace: '
', '|' | split: '|'
assign size_option = false
if settings.layout_productcard == 'variant_picker'
for option in product.options_with_values
if size_triggers contains option.name
assign size_option = option
assign size_option_index = forloop.index0
break
endif
endfor
endif
if product.options_with_values.first.values.first.product_url
assign size_option = false
endif
if product.variants.size == 250
assign quickshop = true
assign enable_color_picker = false
assign size_option = false
endif
assign rating_value = false
assign rating_count = false
if product.metafields.syncer.reviews
assign locale_ratings = product.metafields.syncer.reviews.value.reviews[localization.language.iso_code]
if locale_ratings
assign rating_value = locale_ratings.rating
assign rating_count = locale_ratings.count
else
assign rating_value = product.metafields.syncer.reviews.value.cumulative_rating
assign rating_count = product.metafields.syncer.reviews.value.total_reviews
endif
elsif product.metafields.reviews.rating
assign rating_value = product.metafields.reviews.rating.value
assign rating_count = product.metafields.reviews.rating_count
endif
-%}
{%- if enable_quick_buy_desktop or enable_quick_buy_mobile -%}
{%- liquid
assign product_form_class = 'f8pr form-card ' | append: settings.productcards_text_alignment
if settings.layout_productcard == 'variant_picker' and layout != 'list-compact'
assign product_form_class = product_form_class | append: ' no-border'
endif
assign product_form_id = 'quick-add-' | append: section.id | append: product.id | append: '-quick-add-form_x'
-%}
{%- capture quick_buy -%}
{%- if layout == 'list-compact' -%}
{%- form 'product', product, id: product_form_id, class: product_form_class, novalidate: 'novalidate' -%}
{%- assign available_variants = product.variants | where: "available" -%}
{%- if enable_variant_picker and available_variants.size > 1 and product.variants.size < 250 -%}
{%- else -%} {%- endif -%}
{%- endform -%} {%- else -%} {% if quickshop %}
{{ 'product.form.add_to_cart' | t }}
{% elsif settings.layout_productcard == 'add_to_cart' and product.id %}{{ 'product.form.add_to_cart' | t }}
{% if current_variant.available or preorder %} {% unless collection_page %} {% assign product_form_class = product_form_class %} {% endunless %} {%- form 'product', product, id: product_form_id, class: product_form_class, novalidate: 'novalidate' -%} {%- assign available_variants = product.variants | where: "available" -%} {%- if available_variants.size > 1 -%} {%- else -%}{%- endif -%} {%- endform -%} {% else %}
{{ 'product.form.not_in_stock' | t }}
{% endif %} {% elsif settings.layout_productcard == 'variant_picker' %}{{ 'product.form.add_to_cart' | t }}
{% if size_option %} {%- assign product_form_class = product_form_class | append: ' hidden' -%} {% if size_option.values %} {% comment %}Redirect to product if it has a third option or color swatch is disabled and there is a second option{% endcomment %} {%- liquid assign go_to_product = false if color_option and product.options.size < 3 assign go_to_product = true elsif color_option == false and product.options.size < 2 assign go_to_product = true endif if enable_color_picker if settings.color_swatches_single and colors_size < 2 assign go_to_product = false endif endif if go_to_product assign product_form_class = product_form_class | append: ' product-options' endif %} {% assign product_form_class = product_form_class | append: ' mobile-hide' %} {%- form 'product', product, id: product_form_id, class: product_form_class, novalidate: 'novalidate' -%}{%- if current_variant.available -%} {%- else -%} {%- endif -%}
{%- endform -%}{%- liquid comment start Yagi app code endcomment assign product_price_min = product.price_min assign product_price_max = product.price_max assign current_variant_price = current_variant.price assign current_variant_compare_at_price = current_variant_compare_at_price assign public_or_tags_matched = true if product.metafields.app--168074346497.segment_tags.value.size > 0 assign public_or_tags_matched = false endif for etag in product.metafields.app--168074346497.segment_tags.value if customer.tags contains etag assign public_or_tags_matched = true break endif endfor if public_or_tags_matched assign current_variant_price = current_variant.metafields.app--168074346497.auto_discounted_price.value | default: current_variant.price assign current_variant_compare_at_price = current_variant.compare_at_price assign product_price_min = product.metafields.app--168074346497.min_auto_discounted_price.value | default: product.price_min if shop.metafields.app--168074346497.discount_percentage.value > 0.005 assign discount_percentage = shop.metafields.app--168074346497.discount_percentage.value | times: 1.0 assign deducted_percentage = 1.0 | minus: discount_percentage assign current_variant_price = current_variant.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil endif if current_variant_price < current_variant.price and current_variant_compare_at_price == 0 or current_variant_compare_at_price == blank assign current_variant_compare_at_price = current_variant.price endif if layout == 'list-compact' assign price = current_variant_price | money else assign price = product_price_min | money endif endif assign price_min = product_price_min | money assign price_max = product_price_max | money comment end Yagi app code endcomment -%} {%- if product.price_varies and settings.show_price_varies and layout != 'list-compact' -%} {{ price_min -}} - {{ price_max }} {%- else -%} {%- if current_variant_compare_at_price > current_variant_price -%} {{ current_variant_compare_at_price | money }} {%- endif -%} {{ price }} {%- endif -%} {%- if current_variant.unit_price_measurement -%} {{ 'product.unit_price_label' | t }} {{ current_variant.unit_price | unit_price_with_measurement: current_variant.unit_price_measurement }} {%- endif -%}
{%- endif -%} {%- if quick_buy and layout != 'list-compact' and settings.layout_productcard != 'standard' and layout != 'list' -%}