Help with and Add to Cart button on collection pages

Greenskingames
New Member
1 0 0

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.

https://www.greenskingames.com.au/

Thankyou to anyone who replies.

0 Likes
Matt-Pipelabs
Excursionist
13 1 1

Hey @Greenskingames,

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.

Thanks,

Matt

0 Likes