What you’ll need

  • The variant ID (or the admin link)

    How to get this: The variant ID
    1. Open the product, then click the variant. The ID is the number after /variants/ in the web address.
    2. You can paste the whole link instead; the tool finds the number.

    Step-by-step guide (opens in a new tab)

  • Shopify’s free GraphiQL app (with read_products, write_discounts access)

    How to get this: Shopify’s free GraphiQL app
    1. Install it once from shopify-graphiql-app.shopifycloud.com: enter your store address, tick the access listed here, click Install and approve.
    2. Then open it any time from Apps › Shopify GraphiQL App in your admin.

    Step-by-step guide (opens in a new tab)

  • A duplicate of your theme to test on

    How to get this: A duplicate of your theme to test on
    1. Online Store › Themes › … on your theme › Duplicate.
    2. Make the change on the copy, preview it, and publish only when it works.

    Step-by-step guide (opens in a new tab)

  • The theme code editor (to paste a snippet)

    How to get this: The theme code editor
    1. On the copy of your theme: … › Edit code.
    2. Hover the snippets folder, click New File…, name it as the tool says, paste and Save.

    Step-by-step guide (opens in a new tab)

1The offer

In your store’s currency, before discounts. $50 to $100 is common.

The number after /variants/ on the gift’s page in your admin, or the whole link.

Gift can combine with

Try:

Check the gift and find collection IDs (read-only)

Run in GraphiQL with read_products. Variables: {"variant": "gid://shopify/ProductVariant/…", "collections": "title:all*"}. Paste the result below to check the gift can be added to carts.

Gift lookup
query GiftLookup($variant: ID!, $collections: String!) {
  productVariant(id: $variant) {
    id
    title
    price
    inventoryQuantity
    availableForSale
    product {
      id
      title
      status
      handle
    }
  }
  collections(first: 25, query: $collections) {
    nodes {
      id
      title
      handle
    }
  }
}

    2Check the plan

      3Create the discount

      4Theme snippet

      [remaining] becomes the amount or items left.

      Behaviour

      Install

      1. In your admin, go to Online Store > Themes. On your live theme click … > Duplicate, and work on the copy first.
      2. On the copy, click … > Edit code. Under Snippets, click Add a new snippet, name it est-gwp, paste the snippet, and save.
      3. Open layout/theme.liquid and paste {% render 'est-gwp' %} on its own line just above </body>. Save.
      4. Optional: to show “Spend X more for a free gift”, add <div data-est-gwp-progress></div> where you want the message (for example in the cart drawer or cart page section).
      5. Preview the copy, and run the test checklist below on a development store or with the discount active.
      6. When everything works, publish the copy (or repeat these steps on your live theme).

      Cart drawers

      • Dawn and Shopify’s free themes built on it (Refresh, Sense, Craft, Studio, Taste, Crave, Origin, Ride, Colorblock, Spotlight, Publisher, Trade): The drawer and count update in place: Shopify’s standard updateCart action recognises Dawn, and without it the snippet uses Dawn’s own cart-update event.
      • Horizon and themes built on it: Updates in place through Shopify’s standard updateCart action, which recognises Horizon’s cart.
      • Other themes: Shopify’s updateCart action reloads the page after the gift is added or removed when it doesn’t recognise the theme’s cart. If your theme sends no cart events and has no standard actions, the cart page reloads once and a cart drawer may show the gift the next time it opens. Your developer can listen for the est-gwp:change event to refresh the drawer.
      • Themes with an “upsell” or “free gift” feature, or a gift app: Turn those off for the same gift, or two things will add it.

      Test checklist

      1. Add items just under the minimum: no gift is added, and the progress message shows what’s left to spend.
      2. Reach the minimum: the gift is added once, at 0.00, with the discount title next to it.
      3. Remove items to go back under the minimum: the gift is taken out.
      4. Remove the gift yourself while over the minimum: it stays out for the rest of the visit.
      5. Change the gift’s quantity to 2: it goes back to 1 (only one is free).
      6. Add the gift product on its own from its product page, with nothing else: it is not free, and it isn’t doubled.
      7. Use a discount code at the same time: check which discounts apply at checkout.
      8. Switch to another currency or market (if you sell in several): the gift appears at the converted minimum.
      9. Open the cart drawer and the cart page on a phone: the gift line and the count update without a manual refresh.
      10. Deactivate the discount: the gift is no longer free and the snippet takes it out of carts.

      Uninstall

      1. In snippets/est-gwp.liquid, change "addGift": true to "addGift": false and save. New gifts stop; gifts that aren’t free anymore are still taken out of carts.
      2. Deactivate the discount (Discounts > the gift discount > Deactivate, or run the undo mutation on this page).
      3. A few days later, delete the line {% render 'est-gwp' %} from layout/theme.liquid, delete snippets/est-gwp.liquid, and remove any <div data-est-gwp-progress></div> you added.
      4. Nothing else was changed: the snippet adds no settings, files, apps or theme styles.

      5Check the result, or undo

        Guides

        Questions

        Can a shopper end up paying for the gift?

        The snippet checks Shopify’s own cart: after adding the gift, the gift line must cost 0. If Shopify didn’t make it free (discount off, cart below the minimum), the snippet takes it straight back out and doesn’t retry for that cart.

        Will it work with my theme’s cart drawer?

        Dawn- and Horizon-based themes update in place. Other themes reload the page or show the gift the next time the drawer opens. Test on a duplicate of your theme first.

        How do I remove it?

        Set "addGift" to false in the snippet, deactivate the discount, and a few days later delete the snippet file and the line that renders it. Nothing else in your theme is changed.

        Is anything uploaded?

        No. The kit is built in your browser. You create the discount and add the snippet yourself.

        Based on Shopify’s discountAutomaticBxgyCreate reference (API 2026-10), Buy X get Y discounts, the Cart AJAX API and updateCart.