Activating cart drawer for products without redirect to cart page

Tourist
13 0 0

Hi ya, 

 

Im needing to have my cart drawer updated every time a customer adds a product from the featured collection without having to be redirected to product page or cart page. 

 

I have used this code in the product.card liquid

<form method="post" action="/cart/add">
<input type="hidden" name="id" value="{{ product.variants.first.id }}" />
<input min="1" type="number" id="quantity" name="quantity" value="1"/>
<input type="button" value="Add to cart" class="btn" />
</form>

 

but every time the quantity is updated or the add to cart button is submitted it redirects me to the product page. 

 

Is there a way where the cart drawer can update and slide out when this is done?

 

https://ethaircal.myshopify.com

0 Likes