Ajax cart popup

Highlighted
New Member
1 0 1

Hi,

 

I managed to add an add to cart button to my product collection on my landing page using this. Though, despite many efforts, I havent managed to get the "Add to cart" popup working, that shows up (per standard) when I add something to cart from a product page.

 

<form method="post" action="/cart/add">
<input type="hidden" name="id" value="{{ product.variants.first.id }}" />
<button type="submit" name="add" aria-label="Add to cart " class="btn product-form__cart-submit btn--secondary-accent" aria-haspopup="dialog" data-add-to-cart="">
                  <span data-add-to-cart-text>
                    Add to cart - {{ product.price | money }}
                  </span>
                  <span class="hide" data-loader>
                    {% include 'icon-spinner' %}
                  </span>
                </button>
        <input type="hidden" name="return_to" value="back" />

</form>

I am using the Debut theme. 

 

Any ideas on how to get the native ajax cart popup working for these extra / added "Add to cart" buttons? 

1 Like