How To Add Free Product Automatically To Cart?

Hello,

I am using prestige theme.

I want to add some free products to cart automatically.

When the cart amount of any user reaches a certain limit then we want to add a free product automatically to their carts. I want to create two offers

When the cart amount of any user is greater than 10,000 and less than 15,000 then we want to give a free product and

When the cart amount of any user is greater than 15,000 then want to give another free product.

I have tried a lot and also used some apps but couldn’t find any solution?

Please try to help me as soon as possible…

We do this using the javascript ajax API, here’s the documentation for cart: https://shopify.dev/api/ajax/reference/cart

The typical approach with that is:

  1. Create a script that checks the cart value to see if it’s in the range of your specifications

  2. If it’s in range, add that product to cart (that documentation will show you how) and show a message to let the user know it’s there (Example you can pop a message near the top, with a color that stands out and calls the user to go to their cart to see the free product).

  3. Add an event listener to trigger the script when you want (probably after adding a product to the cart, unless your users always go to cart page before checking out, then you could add the check on cart page)

  4. You probably want to create a script to remove the free product as well if the cart sizes diminishes under the threshold.

If you need help with part of this or want it done for you feel free to reach out to my team at speedboostr.com/contact, we’re a team of Shopify developers that do performance optimization, custom features, theme builds, and apps.

Hi @Riya01,

I’m Ellie from BOGOS, a Shopify specialist. It sounds like you are trying to set up a “Spend X to get Free Gift” offer with multiple tiers. For this to work correctly, you will need to create two separate offers within the app to handle each price range.

I recommend using BOGOS for this setup. Here is how you can structure your offers within the app:

  • Offer 1: Set a cart value condition with a Min of 10,000 and a Max of 15,000 to trigger Gift A. (see the first picture below)

  • Offer 2: Set a Min of 15,000 and leave the Max empty (no limit) to trigger Gift B. (see the second picture below)

What’s great about BOGOS is that it handles the gift swapping automatically. When a customer’s cart reaches 15,000, the app will instantly remove Gift A and add Gift B.

Hope this helps you get your tiered offers running!