how do I stop add to cart button from going straight to checkout?

ohhoneydew
Excursionist
21 2 8

Hello. I have added the following code to show 'add to cart' button under my product grids. I added this in snippets  ->  product-card-grid.liquid

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

 

but when you click the button, it adds to the product to the cart and brings you straight to check out. How can I prevent this and just have it add to cart?

 

www.honeydew.com
PW: creepi

 

Thanks in advance!

KetanKumar
Shopify Partner
20387 2111 7666

@ohhoneydew 

sorry for that issue can you please try this 

https://stackoverflow.com/questions/20643484/add-to-cart-using-ajax-in-shopify

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
ohhoneydew
Excursionist
21 2 8

@KetanKumar sorry, it didn't work  

0 Likes
KetanKumar
Shopify Partner
20387 2111 7666

@ohhoneydew 

oh sorry can you please try this 

https://gist.github.com/marioloncarek/84ccd82a37e864b1959f630f58497733

if you are not able to code 

It can be done by doing some code customization. Please take the help of a developer and hire Shopify Expert or me

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing