Skip to content

Commit

Permalink
1-click Quick Add for products with 1 non-default variant (Shopify#1610)
Browse files Browse the repository at this point in the history
* Add 1-click quick-add support for products with exactly 1 non-default variant

* Revert "Add 1-click quick-add support for products with exactly 1 non-default variant"

This reverts commit 41648ca.

* Add 1-click quick-add support for products with exactly 1 non-default variant

* Switch to Variants Size
  • Loading branch information
bredowmax authored and pjhardie committed Jun 13, 2022
1 parent 075b2c5 commit 0e3b12d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snippets/card-product.liquid
Expand Up @@ -172,8 +172,8 @@
{%- if show_quick_add -%}
<div class="quick-add">
{%- assign product_form_id = 'quick-add-' | append: section_id | append: card_product.id -%}
{%- if card_product.has_only_default_variant -%}
<product-form data-cart-type="{{ settings.cart_type }}">
{%- if card_product.variants.size == 1 -%}
<product-form>
{%- form 'product', card_product, id: product_form_id, class: 'form', novalidate: 'novalidate', data-type: 'add-to-cart-form' -%}
<input type="hidden" name="id" value="{{ card_product.selected_or_first_available_variant.id }}" disabled>
<button
Expand Down

0 comments on commit 0e3b12d

Please sign in to comment.