How to automatically add free gift to cart when spending threshold is met (without third party apps)

Topic summary

A user seeks to automatically add a free gift to the cart when customers reach a spending threshold, specifically wanting to avoid Shopify’s native “Buy X Get Y” discount that requires manual product addition.

Native Solution:

  • Custom coding using Shopify’s AJAX Cart API is the only non-app approach
  • Shopify Plus users can implement Shopify Scripts or JavaScript/Liquid functions in their theme
  • Requires checking cart totals and programmatically adding the gift product variant ID

Third-Party App Recommendations:
Multiple app developers suggest their solutions:

  • BOGOS: Free Gift, Discounts & Bundles - Automatically adds gifts when threshold is met, includes a lifetime free plan (2000+ reviews, 4.9★)
  • BOGO+ Buy X Get Y & Free Gift - Offers auto-add or pop-up notification options
  • Discount Ray – Wholesale Pricing - Features preselected gift products with 14-day free trial
  • AiTrillion - Generates dynamic discount codes via email/SMS/WhatsApp

Key Limitation:
Shopify’s platform changes increasingly require customer interaction for cart additions, making third-party apps the more practical solution for automatic gift functionality.

Summarized with AI on October 24. AI used: claude-sonnet-4-5-20250929.

Hello,

Does anyone know how I can automatically add free gift to cart when a customer meets spending threshold without having to use a third party app?

I’m aware of the “buy X get Y” discount but don’t like how the customer has to add the free gift/product to their cart themselves.

Without a 3rd party app, your best bet is to write the code yourself, using the AJAX Cart API:

https://shopify.dev/docs/api/ajax/reference/cart

Hi Bhristopher,

There is an app that can fulfill your need, if you wanna try the 3rd-party one, give a try on this BOGO+ Buy X Get Y & Free Gift.

With BOGO+, you can offer gift based on cart value. For example, if the cart value reached $100, the gift would be automatically added to the cart. Or you can show the gift via pop-up notification.

For better visualization, you can check in the demo store.

Hi @bhristopher

Since Shopify will make changes in the cart page, they will always need customers to add the product to cart themselves first.

To have the gift automatically added, try BOGOS: Free Gift, Discounts & Bundles. Once customer meet the threshold, they will have the gift right away in their cart, simplifying your checkout process ^^ Please see my attached screenshot

Untitled design.gif

Instal BOGOS now to try! (2000+ reviews, 4.9 :star: overal ratings)

If my answer is helpful, let me know by giving me a Like or Accept it as Solution

Hi everyone, :pleading_face: :revolving_hearts: please allow me to share a quick update:

:sparkles: BOGOS now has a lifetime FREE PLAN, so you can try what you want for free!

P/s: Here’s the tutorial on How to Auto-add a Free Item to Cart When a Spending Threshold is Met on Shopify:

You can do this by writing a Shopify Script (for Plus) or a JavaScript/Liquid function in your theme. Use cart logic to check when the cart total passes your threshold, then use Shopify’s AJAX API to add the gift product variant ID automatically. Now we’re cutting out third-party apps completely.

Hello @bhristopher

Based on your requirements, if you’re open to using a third-party app, we recommend trying the Discount Ray – Wholesale Pricing app.

This app includes a Personalized Discount feature that allows you to automatically add a free gift product to the cart when a customer reaches a specific spending threshold. The gift product will be preselected automatically, so customers don’t need to choose it themselves.

You can check out the demo product we’ve uploaded for reference.
The app also offers a 14-day free trial, allowing you to explore its features before making a decision.

If you’d like, we can also share a sample product setup to help you get started.

Thank you.

Hello @bhristopher ,

I hope you are well!

Basically, you can create a discount code/gift card with the help of AiTrillion. AiTrillion can help you create the discount code and send Email/SMS/Whatsapp/Flows. So, the discount code will dynamically generated whenever customer complets the spending threshold.

Feel free to let me know if you want to know more.

Also, you can check our app by visiting - https://www.aitrillion.com/