Automatically add discounted item to cart

Solved
Caroline4
New Member
7 0 0

Hi there,

We're currently running a promotion in our store where, with every order, the customer will receive a free cleaning brush (specifically this item: link ).

Right now, we're using Shopify's built in Automatic discount's "Buy X get Y" functionality, but unfortunately in order for the customer to get a free brush, they have to hunt down this item in the store and manually add it to the cart. 

So my question is: Is there a way to automatically have this brush appear in the cart when someone adds other items?

If there's a way to accomplish this via code, please let me know (I have access and applied custom code in the past).

I'm not too keen on using apps, if I can help it (partly due to pricing but also we have too many apps already and it's starting to effect store speed). However if the only option is to use a specific app, let me know and I'll check it out.

Kind regards,

Caroline M

0 Likes
gina-gregory
Shopify Expert
710 48 176

This is an accepted solution.

This can be done with some javascript using the Ajax API. https://shopify.dev/docs/themes/ajax-api/reference/cart#post-cart-add-js

0 Likes
Caroline4
New Member
7 0 0

Great, thanks for the link!

0 Likes