Skip to content

Commit

Permalink
Add 1-click quick-add support for products with exactly 1 non-default…
Browse files Browse the repository at this point in the history
… variant
  • Loading branch information
bredowmax committed Apr 10, 2022
1 parent d37c2e0 commit 41648ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snippets/card-product.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
{%- 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 -%}
{%- if card_product.has_only_default_variant or card_product.card_product.options.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>
Expand Down

0 comments on commit 41648ca

Please sign in to comment.