{%- liquid assign buybutton_setting = false assign gift_card_recipient_feature_active = false assign current_variant = product.selected_or_first_available_variant if block.settings.enable_gift_card_recipient and product.gift_card? assign gift_card_recipient_feature_active = true endif comment Quick buy buttons are incompatable with gift card products and subscription products endcomment if block.settings.enable_payment_button and gift_card_recipient_feature_active == false assign buybutton_setting = true endif if product.selling_plan_groups.size > 0 assign buybutton_setting = false endif -%}
{% comment %} The [data-product-form] tag distinguishes the product form from upsell instant-add-buttons. {% endcomment %} {%- form 'product', product, id: uniq_id, data-product-form: '', data-product-handle: product.handle -%} {%- unless hidden -%}
{% comment %} Note: the gift card recipient form is controlled in Checkout and must contain these undocumented line item propeties: * properties[__shopify_send_gift_card_to_recipient] - Hidden - Toggles the feature on/off in checkout, following properties have no effect without it * properties[Recipient email] - The email of the gift card recipient * properties[Recipient name] - The name of the gift card recipient * properties[Message] - Shopify chose a highly generic name for the gift card message, this could easily conflict with an app or custom code {% endcomment %} {%- if gift_card_recipient_feature_active -%} {%- render 'gift-card-recipient-form', product: product, form: form, section: section -%} {%- endif -%}
{%- assign button_text = 'products.product.add_to_cart' | t -%} {%- if product.metafields.theme.preorder.value == true -%} {% comment %} Add a line item property with 'Sale type: Pre-order' and make the button say 'Pre-order'{% endcomment %} {%- assign button_text = 'products.product.pre_order' | t -%} {%- endif -%} {%- render 'sibling-color-as-line-prop' product: product -%} {%- if current_variant == null -%} {%- assign button_text = 'products.product.unavailable' | t -%} {%- endif -%} {%- if current_variant.available == false -%} {%- assign button_text = 'products.product.sold_out' | t -%} {%- endif -%}
{{ 'products.product.adding_to_cart' | t }} {{ 'products.product.added_to_cart' | t }} {%- if buybutton_setting -%}
{{ form | payment_button }}
{%- endif -%}
{% comment %} Shop pay split payment terms {% endcomment %}
{{- form | payment_terms -}}
{%- endunless -%} {% comment %} The input with name="id" indicates the variant to add to cart {% endcomment %} {%- endform -%}