{%- liquid if empty_state assign product_link = '/admin/products' assign vendor = 'home_page.onboarding.product_vendor' | t assign title = 'home_page.onboarding.product_title' | t assign compare_at_price = 2999 assign price = 1999 else assign variant = product.first_available_variant assign product_link = product.url | within: collection assign vendor = product.vendor assign title = product.title assign compare_at_price = product.compare_at_price assign price = product.price endif # start yagi app code assign product_price_min = product.price_min unless empty_state assign active_discount = true assign empty_array = "" | split: "" assign dormant_discounts = shop.metafields.app--168074346497.dormant_discounts.value | default: empty_array assign target_discount_id = product.metafields.app--168074346497.applied_discount_id.value for dormant_discount in dormant_discounts if dormant_discount == target_discount_id assign active_discount = false endif endfor if active_discount assign price = product.metafields.app--168074346497.min_auto_discounted_price.value | default: product.price assign compare_at_price = product.compare_at_price if product.metafields.app--168074346497.discount_percentage.value > 0.01 assign deducted_percentage = 1.0 | minus: product.metafields.app--168074346497.discount_percentage.value assign price = product.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil assign product_price_min = price assign compare_at_price = product.price if product.compare_at_price > compare_at_price assign compare_at_price = product.compare_at_price endif endif endif endunless # end yagi app code assign is_on_sale = false assign is_sold_out = true if compare_at_price > price assign is_on_sale = true endif if product.available or empty_state assign is_sold_out = false endif assign has_hover_image = false assign has_touch_image = false if settings.dbtfy_show_second_image_on_hover_show_on_hover and product.media.size > 1 assign has_hover_image = true assign hover_image = product.media[1].preview_image endif if settings.dbtfy_show_second_image_on_hover_enable_touch_screen and product.media.size > 1 assign has_touch_image = true endif assign variant = product.selected_or_first_available_variant capture product_collections for collection in product.collections echo collection.handle unless forloop.last echo ',' endunless endfor endcapture assign has_color_swatches = false if settings.dbtfy_color_swatches_grid_options != blank if product.available and product.variants.size > 1 assign has_color_swatches = true endif endif assign hover_animation = settings.dbtfy_show_second_image_on_hover_hover_animation case hover_animation when 'fade' assign hover_animation_class = 'animation-fade' when 'none' assign hover_animation_class = 'animation-none' when 'zoom' assign hover_animation_class = 'animation-zoom' endcase assign enable_hover_carousel = settings.dbtfy_show_second_image_on_hover_enable_carousel -%}
{%- if product.price_varies and empty_state == false -%} {{ product_price_min | money }} + {%- else -%} {{ price | money }} {%- endif -%} {%- if is_on_sale -%} {{ compare_at_price | money }} {%- else -%} {%- endif -%} {%- if variant.available and variant.unit_price_measurement -%} {%- capture unit_price_separator -%} {{ 'general.accessibility.unit_price_separator' | t }} {%- endcapture -%} {%- capture unit_price_base_unit -%} {%- if variant.unit_price_measurement.reference_value != 1 -%} {{- variant.unit_price_measurement.reference_value -}}{%- endif -%} {{ variant.unit_price_measurement.reference_unit }} {%- endcapture -%} {{ 'products.general.unit_price' | t }} {{ variant.unit_price | money }} {{- unit_price_separator -}} {{- unit_price_base_unit -}} {%- endif -%}
{%- endif -%}