Hi there I am trying to add an add to cart button to my collection pages underneath each product that doesn't redirect the customer to the cart page but lets them keep browsing their current collection page.
The catch is I have to exclude certain products in my Paints and Accessories collection from having an add to cart button as they have a whole lot of variants..
Is there anyway of doing this?
This is what the store currently looks like.
Thankyou to anyone who replies.
You can do this using the Ajax Cart API. https://shopify.dev/api/ajax/reference/cart
It allows you add products to the cart without leaving the page. You could set it up so it only shows for products which have one variant through a simple rule.
Flick me a message if this is something you'd like help with.