diff --git a/themes/meraki/sections/product.liquid b/themes/meraki/sections/product.liquid index b1bbd63f..c03227e0 100644 --- a/themes/meraki/sections/product.liquid +++ b/themes/meraki/sections/product.liquid @@ -170,12 +170,6 @@ "type": "checkbox", "default": true }, - { - "type": "checkbox", - "id": "skip_cart", - "label": "Skip cart", - "default": false - }, { "label": "Background color", "id": "background_color", diff --git a/themes/meraki/snippets/add-to-cart.liquid b/themes/meraki/snippets/add-to-cart.liquid index 5af3c60a..cd1ad97b 100644 --- a/themes/meraki/snippets/add-to-cart.liquid +++ b/themes/meraki/snippets/add-to-cart.liquid @@ -31,17 +31,19 @@ class='spinner hidden' id='loading__cart' ></span> - <span> - {{ text }} - </span> + {% if skip_cart %} + <span>{{ 'snippets.product_preview.cta_button' | t }}</span> + {% else %} + <span> + {{ text }} + </span> + {% endif %} </button> </div> {% javascript %} - const TRANSLATED_TEXT = { empty_inventory: "{{ 'errors.empty_inventory' | t }}" } - - const IS_CART_SKIPED = "{{ skip_cart }}"; + const IS_CART_SKIPED = Boolean("{{ skip_cart }}"); {% endjavascript %} diff --git a/themes/meraki/snippets/product-preview.liquid b/themes/meraki/snippets/product-preview.liquid index 3363dfa5..581ea83f 100644 --- a/themes/meraki/snippets/product-preview.liquid +++ b/themes/meraki/snippets/product-preview.liquid @@ -35,7 +35,7 @@ </a> <div class="product-link-mobile"> - {% if settings.direct_add_to_cart and item.variants.size <= 1 %} + {% if settings.direct_add_to_cart and item.variants.size <= 1 and item.skip_to_checkout == false %} <button class="yc-btn" onclick="directAddToCart(event, '{{ item.variants[0].id }}', {{ item.variants[0].inventory }}, {{ item.isTrackingInventory }})"> {{ 'general.direct_add_to_cart' | t }} </button> diff --git a/themes/meraki/snippets/product-slider.liquid b/themes/meraki/snippets/product-slider.liquid index ea2b4a5e..e7ae6e59 100644 --- a/themes/meraki/snippets/product-slider.liquid +++ b/themes/meraki/snippets/product-slider.liquid @@ -66,7 +66,7 @@ </div> {% endif %} <div class="product-link"> - {% if settings.direct_add_to_cart and block.settings.product.variants.size <= 1 %} + {% if settings.direct_add_to_cart and block.settings.product.variants.size <= 1 and block.settings.product.skip_to_checkout == false %} <button class="yc-btn" onclick="directAddToCart(event, '{{ block.settings.product.variants[0].id }}', {{ block.settings.product.variants[0].inventory }}, {{ block.settings.product.isTrackingInventory }});"> {{ 'general.direct_add_to_cart' | t }} </button> diff --git a/themes/meraki/snippets/single-product-placeholder.liquid b/themes/meraki/snippets/single-product-placeholder.liquid index 2c7fa6cf..a163f151 100644 --- a/themes/meraki/snippets/single-product-placeholder.liquid +++ b/themes/meraki/snippets/single-product-placeholder.liquid @@ -39,7 +39,7 @@ {%- when 'product_description' -%} <p class='product-description'>This is a placeholder description for the product.</p> {%- when 'add_to_cart' -%} - {% render 'add-to-cart', text: block.settings.text_content, is_sticky: block.settings.is_sticky, background_color: block.settings.background_color, text_color: block.settings.text_color, is_placeholder : is_placeholder %} + {% render 'add-to-cart', text: block.settings.text_content, is_sticky: block.settings.is_sticky, background_color: block.settings.background_color, text_color: block.settings.text_color, is_placeholder : is_placeholder, skip_cart: product.skip_to_checkout %} {%- when 'accordion' -%} {%- render 'accordion', accordion_title: block.settings.accordion_title, accordion_details: block.settings.accordion_details, background_color: block.settings.background_color, text_color: block.settings.text_color, space_bottom: block.settings.space_bottom -%} {%- when 'express_checkout' -%} diff --git a/themes/meraki/snippets/single-product.liquid b/themes/meraki/snippets/single-product.liquid index b8d8f264..429d9c44 100644 --- a/themes/meraki/snippets/single-product.liquid +++ b/themes/meraki/snippets/single-product.liquid @@ -66,7 +66,7 @@ {%- when 'stock' -%} {% render 'stock', stock_title: block.settings.stock_title, stock_items_left: block.settings.stock_items_left, total_stock_items: block.settings.total_stock_items %} {%- when 'add_to_cart' -%} - {% render 'add-to-cart', text: block.settings.text_content, is_sticky: block.settings.is_sticky, background_color: block.settings.background_color, text_color: block.settings.text_color, snippetId: snippetId, skip_cart: block.settings.skip_cart %} + {% render 'add-to-cart', text: block.settings.text_content, is_sticky: block.settings.is_sticky, background_color: block.settings.background_color, text_color: block.settings.text_color, snippetId: snippetId, skip_cart: product.skip_to_checkout %} {%- when 'accordion' -%} {%- render 'accordion', accordion_title: block.settings.accordion_title, accordion_details: block.settings.accordion_details, border_color: block.settings.border_color, text_color: block.settings.text_color, space_bottom: block.settings.space_bottom -%} {%- when 'express_checkout' -%}