{% render 'theme-drawer-styles' %} {% liquid assign block_settings = block.settings assign product = closest.product if request.visual_preview_mode and product == blank assign product = collections.all.products.first endif assign variant = closest.product.selected_or_first_available_variant assign inventory_quantity = variant.inventory_quantity assign inventory_policy = variant.inventory_policy if variant.inventory_management == 'shopify' assign inventory_managed = true endif assign can_add_to_cart = false assign add_to_cart_text = 'products.product.unavailable' | t if variant if variant.quantity_rule.min > variant.inventory_quantity and inventory_managed and inventory_policy == 'deny' assign quantity_rule_soldout = true endif if variant.available assign can_add_to_cart = true assign add_to_cart_text = 'products.product.add_to_cart' | t elsif inventory_managed and inventory_quantity <= 0 and inventory_policy == 'deny' or quantity_rule_soldout assign can_add_to_cart = false assign add_to_cart_text = 'products.product.sold_out' | t else assign can_add_to_cart = false assign add_to_cart_text = 'products.product.unavailable' | t endif endif %} {%- if product != blank -%} {%- assign product_form_id = 'BuyButtons-ProductForm-' | append: section.id -%}
{%- form 'product', product, id: product_form_id, data-type: 'add-to-cart-form' -%} {%- if block_settings.gift_card_form and product.gift_card? -%} {%- render 'gift-card-recipient-form', product: product, form: form, section: section, block: block -%} {%- endif -%}
{%- unless block_settings.gift_card_form and product.gift_card? -%} {%- endunless -%} {%- liquid assign has_quantity_rules = false if variant.quantity_rule.min > 1 or variant.quantity_rule.increment > 1 or variant.quantity_rule.max != null assign has_quantity_rules = true endif -%} {%- if has_quantity_rules -%} {%- assign cart_quantity = cart | item_count_for_variant: variant.id -%}
{{ 'products.product.quantity' | t }} ({{ cart_quantity }} {{ 'products.product.in_cart' | t }})
{%- endif -%} {% content_for 'block', type: 'quantity', id: 'quantity' %} {%- if has_quantity_rules -%}
{%- if variant.quantity_rule.increment > 1 -%} {{ 'products.product.quantity_increments' | t: increment: variant.quantity_rule.increment }} {%- endif -%} {%- if variant.quantity_rule.min > 1 -%} {{ 'products.product.quantity_minimum' | t: minimum: variant.quantity_rule.min }} {%- endif -%} {%- if variant.quantity_rule.max != null -%} {{ 'products.product.quantity_maximum' | t: maximum: variant.quantity_rule.max }} {%- endif -%}
{%- endif -%} {%- if product.quantity_price_breaks_configured? and variant.quantity_price_breaks.size > 0 -%} {%- liquid assign use_currency = settings.currency_code_enabled_product_pages -%} {{ 'content.volume_pricing' | t }}
{{ variant.quantity_rule.min }}+ {%- if use_currency -%} {{- variant.price | money_with_currency | strip -}} {%- else -%} {{- variant.price | money | strip -}} {%- endif -%}/{{ 'content.each_abbreviation' | t -}}
{%- for price_break in variant.quantity_price_breaks limit: 2 -%} {%- liquid assign row_index = forloop.index if row_index == 1 assign row_class = 'volume-pricing__row volume-pricing__row--odd' else assign row_class = 'volume-pricing__row volume-pricing__row--even' endif -%}
{{ price_break.minimum_quantity }}+ {%- if use_currency -%} {{- price_break.price | money_with_currency | strip -}} {%- else -%} {{- price_break.price | money | strip -}} {%- endif -%}/{{ 'content.each_abbreviation' | t -}}
{%- endfor -%} {%- if variant.quantity_price_breaks.size > 2 -%}
{%- for price_break in variant.quantity_price_breaks offset: 2 -%} {%- liquid assign collapsed_index = forloop.index assign total_index = collapsed_index | plus: 2 assign modulo_result = total_index | modulo: 2 if modulo_result == 1 assign row_class = 'volume-pricing__row volume-pricing__row--odd' else assign row_class = 'volume-pricing__row volume-pricing__row--even' endif -%}
{{ price_break.minimum_quantity }}+ {%- if use_currency -%} {{- price_break.price | money_with_currency | strip -}} {%- else -%} {{- price_break.price | money | strip -}} {%- endif -%}/{{ 'content.each_abbreviation' | t -}}
{%- endfor -%}
{%- endif -%}
{%- endif -%} {% content_for 'block', type: 'add-to-cart', id: 'add-to-cart', can_add_to_cart: can_add_to_cart, add_to_cart_text: add_to_cart_text %} {% content_for 'block', type: 'accelerated-checkout', id: 'accelerated-checkout', can_add_to_cart: can_add_to_cart, form_obj: form %}
{%- if block_settings.gift_card_form and product.gift_card? -%}
{%- endif -%} {%- endform -%}
{%- else -%}
{%- endif -%}
{% if block_settings.show_pickup_availability %} {%- assign pick_up_availabilities = closest.product.selected_or_first_available_variant.store_availabilities | where: 'pick_up_enabled', true -%} {% if can_add_to_cart %}

{{ 'actions.view_store_information' | t }}

{{ closest.product.title }}

{% unless closest.product.has_only_default_variant %}

{{ closest.product.selected_or_first_available_variant.title }}

{% endunless %}
{% for pick_up_availability in pick_up_availabilities %}

{{ pick_up_availability.location.name }}

{% if pick_up_availability.available %} {{- 'icon-available.svg' | inline_asset_content -}} {% assign pickup_time = pick_up_availability.pick_up_time | downcase %} {{ 'content.pickup_available_in' | t: pickup_time: pickup_time }} {% else %} {{- 'icon-unavailable.svg' | inline_asset_content -}} {{ 'content.pickup_not_available' | t }} {% endif %}
{{ pick_up_availability.location.address | format_address }} {{ pick_up_availability.location.address.phone }}
{% endfor %}
{% endif %} {% endif %} {% render 'buy-buttons-styles' %} {% schema %} { "name": "t:names.product_buy_buttons", "tag": null, "settings": [ { "type": "checkbox", "id": "stacking", "label": "t:settings.always_stack_buttons", "default": false }, { "type": "color", "id": "text_color", "label": "t:settings.text_color", "placeholder": "t:settings.default" }, { "type": "header", "content": "t:content.local_pickup" }, { "type": "checkbox", "id": "show_pickup_availability", "label": "t:settings.show_pickup_availability", "default": true }, { "type": "paragraph", "content": "t:content.local_pickup_description" }, { "type": "header", "content": "t:content.gift_card_products" }, { "type": "checkbox", "id": "gift_card_form", "label": "t:settings.gift_card_form", "default": true }, { "type": "paragraph", "content": "t:content.gift_card_form_description" }, { "type": "select", "id": "recipient_button_style", "label": "t:settings.button_style", "options": [ { "value": "default", "label": "t:options.default" }, { "value": "custom", "label": "t:options.custom" } ], "default": "default", "visible_if": "{{ block.settings.gift_card_form }}" }, { "type": "color", "id": "recipient_button_background", "label": "t:settings.background", "default": "{{ settings.color_palette.background }}", "alpha": true, "visible_if": "{{ block.settings.gift_card_form and block.settings.recipient_button_style == \"custom\" }}" }, { "type": "color", "id": "recipient_button_text", "label": "t:settings.text", "default": "{{ settings.color_palette.foreground }}", "alpha": true, "visible_if": "{{ block.settings.gift_card_form and block.settings.recipient_button_style == \"custom\" }}" }, { "type": "color", "id": "recipient_button_border", "label": "t:settings.borders", "default": "{{ settings.color_palette.foreground }}", "alpha": true, "visible_if": "{{ block.settings.gift_card_form and block.settings.recipient_button_style == \"custom\" }}" }, { "type": "select", "id": "selected_recipient_button_style", "label": "t:settings.selected_button_style", "options": [ { "value": "default", "label": "t:options.default" }, { "value": "custom", "label": "t:options.custom" } ], "default": "default", "visible_if": "{{ block.settings.gift_card_form }}" }, { "type": "color", "id": "selected_recipient_button_background", "label": "t:settings.background", "default": "{{ settings.color_palette.foreground }}", "alpha": true, "visible_if": "{{ block.settings.gift_card_form and block.settings.selected_recipient_button_style == \"custom\" }}" }, { "type": "color", "id": "selected_recipient_button_text", "label": "t:settings.text", "default": "{{ settings.color_palette.background }}", "alpha": true, "visible_if": "{{ block.settings.gift_card_form and block.settings.selected_recipient_button_style == \"custom\" }}" }, { "type": "color", "id": "selected_recipient_button_border", "label": "t:settings.borders", "default": "{{ settings.color_palette.foreground }}", "alpha": true, "visible_if": "{{ block.settings.gift_card_form and block.settings.selected_recipient_button_style == \"custom\" }}" }, { "type": "select", "id": "input_style", "label": "t:settings.input_style", "options": [ { "value": "default", "label": "t:options.input_field" }, { "value": "custom", "label": "t:options.custom" } ], "default": "default", "info": "t:info.edit_input_field_in_theme_settings", "visible_if": "{{ block.settings.gift_card_form }}" }, { "type": "color", "id": "input_background_color", "label": "t:settings.background", "default": "{{ settings.color_palette.background }}", "visible_if": "{{ block.settings.gift_card_form and block.settings.input_style == \"custom\" }}" }, { "type": "color", "id": "input_text_color", "label": "t:settings.text", "default": "{{ settings.color_palette.foreground }}", "visible_if": "{{ block.settings.gift_card_form and block.settings.input_style == \"custom\" }}" }, { "type": "color", "id": "input_border_color", "label": "t:settings.borders", "default": "{{ settings.color_palette.foreground }}", "visible_if": "{{ block.settings.gift_card_form and block.settings.input_style == \"custom\" }}" }, { "type": "range", "id": "border_width", "label": "t:settings.border_width", "min": 0, "max": 4, "step": 0.5, "unit": "px", "default": 1, "visible_if": "{{ block.settings.gift_card_form and block.settings.input_style == \"custom\" }}" }, { "type": "range", "id": "border_radius", "label": "t:settings.border_radius", "min": 0, "max": 50, "step": 1, "unit": "px", "default": 0, "visible_if": "{{ block.settings.gift_card_form and block.settings.input_style == \"custom\" }}" }, { "type": "header", "content": "t:content.padding" }, { "type": "range", "id": "padding-block-start", "label": "t:settings.top", "min": 0, "max": 100, "step": 1, "unit": "px", "default": 0 }, { "type": "range", "id": "padding-block-end", "label": "t:settings.bottom", "min": 0, "max": 100, "step": 1, "unit": "px", "default": 0 }, { "type": "range", "id": "padding-inline-start", "label": "t:settings.left", "min": 0, "max": 100, "step": 1, "unit": "px", "default": 0 }, { "type": "range", "id": "padding-inline-end", "label": "t:settings.right", "min": 0, "max": 100, "step": 1, "unit": "px", "default": 0 } ], "presets": [ { "name": "t:names.product_buy_buttons", "category": "t:categories.product", "blocks": { "quantity": { "type": "quantity", "static": true }, "add-to-cart": { "type": "add-to-cart", "static": true, "settings": { "style_class": "button-secondary" } }, "accelerated-checkout": { "type": "accelerated-checkout", "static": true } } } ] } {% endschema %}