snippets/product.liquid
{% assign fitting_guide_icon = fitting_guide_icon | default: blank %}
{% assign fitting_guide_url = fitting_guide_url | default: blank %}
{% assign show_brand_names = show_brand_names | default: false %}
{% assign show_email_link = show_email_link | default: false %}
{% assign callout = callout | default: false %}
{% assign show_quantity = show_quantity | default: false %}
{% assign show_spb = show_spb | default: false %}
{% assign selected_variant = product.selected_or_first_available_variant %}
{% unless product.available %}
{% assign selected_variant = product.variants | sort: ‘price’ | last %}
{% endunless %}
{% assign is_default = product.has_only_default_variant %}
{% assign enable_image_zoom = enable_image_zoom | default: false %}
{% assign gallery_layout = gallery_layout | default: ‘list’ %}
{% assign selected_media = selected_variant.featured_media | default: product.featured_media %}
{% assign show_media_borders = show_media_borders | default: false %}
{% assign onboarding = onboarding | default: false %}
{% assign details_alignment = details_alignment | default: section.settings.details_alignment %}
{% if product.selling_plan_groups.size > 0 %}
{% assign product_has_subscription = true %}
{% endif %}
{% comment %}
{% if product.handle contains ‘impeachment’ %}
{% assign use_cta_links = true %}
{% endif %}
{% endcomment %}
{%
render 'product-gallery',
product: product,
selected_media: selected_media,
gallery_layout: gallery_layout,
show_media_borders: show_media_borders,
enable_image_zoom: enable_image_zoom,
%}
{% if show_brand_names %}
{% if product != empty %}
{{ product.vendor }}
{% else %}
{{ 'onboarding.product_vendor' | t }}
{% endif %}
{% endif %}
{% if product != empty %}
{{ product.title }}
{% else %}
{{ 'onboarding.product_name' | t }}
{% endif %}
{% render 'okendo-reviews-product-rating-summary', product: product %}
{% if product.metafields.global.subtitle != blank %}
{{ product.metafields.global.subtitle }}
{% endif %}
{% assign in_spirits_collection = false %}
{% assign in_hard_seltzer_collection = false %}
{% for collection in product.collections %}
{% if in_spirits_collection == false and collection.title == ‘Spirits’ %}
{% assign in_spirits_collection = true %}
{% elsif in_spirits_collection == false and collection.title == ‘Hard Seltzer’ %}
{% assign in_spirits_collection = true %}
{% assign in_hard_seltzer_collection = true %}
{% endif %}
{% endfor %}
{% if product != empty %}
{{ selected_variant.price | money }}
({{ selected_variant.compare_at_price | money }}Value)
{% else %}
{{ 'onboarding.product_price' | t }}
{% endif %}
{% capture total_quantity %}
{{ selected_variant.unit_price_measurement.quantity_value }}{{ selected_variant.unit_price_measurement.quantity_unit }}{% endcapture %}
{% capture unit_price %}
{{ selected_variant.unit_price | money }}{% endcapture %}
{% capture unit_measure %}
{%- if selected_variant.unit_price_measurement.reference_value != 1 -%}{{ selected_variant.unit_price_measurement.reference_value }}{%- endif %}{{ selected_variant.unit_price_measurement.reference_unit }}{% endcapture %}
{{ 'products.product.price_per_unit_html' | t: total_quantity: total_quantity, unit_price: unit_price, unit_measure: unit_measure | strip_newlines }}
{%- capture tax_text -%}
{{ ‘products.product.tax_line_html’ | t }}
{%- endcapture -%}
{%- if tax_text != blank -%}
{{ tax_text }}
{%- endif -%}
{% if in_spirits_collection and use_cta_links %}
{% render ‘cta-links-gin-vodka’ %}
{% endif %}
{% if show_sku and selected_variant.sku != empty %}
{{ ‘products.product.sku’ | t }}
<span
data-product-variant-sku
{{- selected_variant.sku | default: ‘’ -}}
{% endif %}
{% unless in_spirits_collection and use_cta_links %}
{% assign form_id = product.id %}
{% capture form_classes %}
product-form
{% if show_spb %}
product-form-has-spb
{% endif %}
{% if selected_variant.available == false %}
product-form-outofstock
{% endif %}
{% endcapture %}
{% if product != empty and product.available %}
{%
form ‘product’,
product,
data-productid: product.id,
id: form_id,
class: form_classes,
data-product-form: “”
%}
{% unless is_default %}
{%
render 'product-options',
product: product,
form_id: form_id,
selected_variant: selected_variant,
style: variant_options_style
%}
{% else %}
{% endunless %}
{% if in_spirits_collection %}
Please select your state
{% unless product.handle contains "riverine" %}
{% if show_quantity %}
{% comment %}
{% endcomment %}
{% else %}
{% endif %}
{% endunless %}
{% if product_has_subscription %}
{{ 'products.product_item.add_to_cart' | t }}
{% endif %}
{% if selected_variant.available %}
{{ 'products.product_item.add_to_cart' | t }}
{% else %}
{{ 'products.product_item.sold_out' | t }}
{% endif %}
{{ 'products.product_item.unavailable' | t }}
{% render 'icon' with 'spinner' %}
Email me when available
{% else %}
{% unless product.handle contains "riverine" %}
{% if show_quantity %}
{% comment %}
{% endcomment %}
{% else %}
{% endif %}
{% endunless %}
{% if product_has_subscription %}
{{ 'products.product_item.add_to_cart' | t }}
{% endif %}
{% if selected_variant.available %}
{{ 'products.product_item.add_to_cart' | t }}
{% else %}
{{ 'products.product_item.sold_out' | t }}
{% endif %}
{{ 'products.product_item.unavailable' | t }}
{% render 'icon' with 'spinner' %}
Email me when available
{% endif %}
{% if show_spb %}
{{ form | payment_button }}
{% endif %}
{% endform %}
{% else %}
{%
form 'product',
product,
id: form_id,
class: form_classes,
data-product-form: ""
%}
{% unless is_default %}
{%
render 'product-options',
product: product,
form_id: form_id,
selected_variant: selected_variant,
style: variant_options_style
%}
{% else %}
{% endunless %}
{{ 'products.product.sold_out' | t }}
{% endform %}
{% endif %}
{% endunless %}
{% assign product_interaction_count = 0 %}
{% if fitting_guide_url != blank %}
{% assign product_interaction_count = product_interaction_count | plus: 1 %}
{% endif %}
{% if show_email_link %}
{% assign product_interaction_count = product_interaction_count | plus: 1 %}
{% endif %}
{% if show_social_buttons %}
{% assign product_interaction_count = product_interaction_count | plus: 1 %}
{% endif %}
{% if product_interaction_count > 0 %}
{% if fitting_guide_url != blank %}
{% render 'icon' with fitting_guide_icon %}
{{ 'products.product.fitting_guide' | t }}
{% endif %}
{% if show_email_link %}
<a
class=“product-interaction email-us”
href=“mailto:{{ shop.email }}?Subject={{ product.title | escape }}”
{% render ‘icon’ with ‘mail’ %}
{{ ‘products.product.email_us’ | t }}
{% endif %}
{% if show_social_buttons %}
{% assign product_canonical_url = shop.url | append: product.url %}
{% assign product_email_subject = ‘products.product.share_email_subject’ | t: product: product.title %}
{% assign product_email_body = ‘products.product.share_email_body’ | t: product: product.title, product_url: product_canonical_url %}
{% assign product_image = product.featured_media.preview_image | default: page_image | img_url: ‘1024x1024’ %}
{% assign product_description = product.title | escape %}
{%
render 'share-this',
share_canonical_url: product_canonical_url,
email_subject: product_email_subject,
email_body: product_email_body,
image: product_image,
description: product_description,
%}
{% endif %}
{% endif %}
{% if show_description and product.description.size > 0 %}
{{ product.description }}
{% endif %}
{% if callout %}
{{ ‘products.product.visit_page’ | t }}→
{% endif %}
{% if product.metafields.global.product_video != blank %}
{{ product.metafields.global.product_video }}
{% if product.metafields.global.product_description != blank %}
{{ product.metafields.global.product_description }}
{% endif %}
{% endif %}
{% if product.metafields.global.nutrition_facts != blank %}
{% render ‘nutrition-facts-popup’, product: product %}
{% endif %}
{%
render ‘product-back-in-stock’,
product: product,
selected_variant: selected_variant
%}
{% render ‘subscription-upsell-modal’, product: product %}