I don't want to be redirected to the cart page when I add a product from the collection page

Highlighted
New Member
1 0 0

Hi,

I'm using the debut theme.

I added the following code to the snippet product-card-grid.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="submit" value="add to cart" class="btn" />
</form>

it works but when I click on the add to cart button, I'm redirected to the cart page. I don't want to be redirected.

Thanks for your help.

0 Likes