{% comment %} Option 1 - Product Page: Opt-in Modal Most recommended option: highest attach rate. REPLACES the theme's buy-buttons section. The Add to Cart button is swapped for one that opens a modal summarising the coverage included in the protection plan, so the customer opts in before the item reaches the cart. Render it in place of your buy-buttons snippet, e.g. in sections/main-product.liquid instead of the default {% render 'buy-buttons' %}. Usage: {% render 'product-opt-in-modal', product: product, block: block, product_form_id: product_form_id, section_id: section.id %} Requirements: - `product`: the product being purchased. Protection plans are discovered via the `akko.plan` metafield (list of product references). - `block`: the block object (for shopify_attributes). - `product_form_id`: the product form id string. - `section_id`: passed through so IDs stay unique if the section renders multiple times. - `show_pickup_availability`: optional boolean. When true the pickup availability block is rendered. --------------------------------------------------------------------------- REFERENCE EXAMPLE - adapt before use. Provided as a starting point and written against Shopify's Dawn theme. Markup, class names and styling will need adjusting to fit your own theme. Always test in a duplicated, unpublished theme before publishing. AKKO does not warrant this code as production-ready for any particular store. --------------------------------------------------------------------------- {% endcomment %}
{%- if product != blank -%} {%- form 'product', product, id: product_form_id, class: 'form', novalidate: 'novalidate', data-type: 'add-to-cart-form' -%}
{%- liquid assign check_against_inventory = true if product.selected_or_first_available_variant.inventory_management != 'shopify' or product.selected_or_first_available_variant.inventory_policy == 'continue' assign check_against_inventory = false endif if product.selected_or_first_available_variant.quantity_rule.min > product.selected_or_first_available_variant.inventory_quantity and check_against_inventory assign quantity_rule_soldout = true endif -%}
{% if product.selling_plan_groups.size > 0 and product.selling_plan_groups[0].selling_plans.size > 0 %}
{{ product.selling_plan_groups[0].selling_plans[0].description }}
{% endif %}
{%- endform -%}
{%- else -%}
{%- endif -%}