Skip to main content

How to Automatically Add a Free Gift With a Discount Code on Shopify

Give a free gift with purchase on Shopify when a customer enters a discount code. Set it up with Discount Plus and Checkout Plus on Shopify Plus.

D
Written by Darian Bia

Heads up: this setup requires a Shopify Plus store with both Checkout Plus and Discount Plus installed.

Want to give a free gift with purchase on Shopify when a customer enters a discount code? Here's how. Discount Plus makes the gift free with a code like FREEGIFT, and Checkout Plus adds the gift to the cart automatically when that code is applied.

It's a simple gift with purchase (GWP) promo: the customer types the code, and the gift shows up in their order marked FREE. No hunting for the product, no extra steps.

Before you start

Step 1: Create the free gift discount code in Discount Plus

  1. In Shopify admin, open Apps → Discount Plus.

  2. Under Discount Types, select Create on Product Discounts.

Discount Plus Discount Types with Create on Product Discounts highlighted
  1. In the Create Product Discounts dialog, select Create next to Free Gift.

Free Gift row with the Create button highlighted
  1. On Create Free Gift Discount, under Step 1: Basic Information, pick the Discount code tab.

  2. Enter a Discount Title and your Discount Code, like FREEGIFT. Customers must enter this code at checkout.

  3. Optional: set Usage Limits and Discount Combinations to fit your promo.

Create Free Gift Discount with the Discount code tab, Discount Code field, and Save highlighted
  1. Scroll to Free Gift Selection and select Select Free Gift Product. Pick your gift. It shows under Selected Free Gift.

  2. Set Maximum number of products this discount applies to to 1 so only one gift is free per order.

  3. Select Save at the top.

Free Gift Selection with Select Free Gift Product, Selected Free Gift, and the maximum number of products highlighted

Step 2: Auto add the free gift with purchase in Checkout Plus

  1. In Checkout Plus, under App blocks, select Customize your Checkout. You can also start from the Gift With Purchase card under Popular Customizations.

Checkout Plus App blocks with Customize your Checkout highlighted
  1. Open Auto Add Product (Gift with Purchase) and select Manage, then create a customization to open the Auto Add Gift/Product To Cart Editor.

Auto Add Product (Gift with Purchase) with the Manage button highlighted
  1. Enter a Customization Name, like Free Gift Example.

  2. Under Select Condition, pick Discount Code Present.

  3. In Discount Code (exact), enter the same code you made in Discount Plus, like FREEGIFT.

  4. Under Remove gift when the trigger is no longer met, keep Remove gift from cart when condition is not met (recommended) and Only remove if added by this app checked.

  5. Make sure Status in the Summary is Active.

Auto Add editor with Discount Code Present, Discount Code (exact), remove gift options, and Status highlighted
  1. Under Step #3: Select Products to add to the cart at Checkout, select Select Product and pick the same gift product you chose in Discount Plus.

  2. Optional: use Variants in this offer, Quantity, and Enforce Quantity Limit to fine tune the gift.

Step #3 with the free product note and the selected gift product highlighted
  1. Under Optional Settings, check Product becomes free when added to cart (with automatic discount codes). This is the key setting. The gift is only added automatically if it becomes free from a discount code. If it's not free, it's offered as an optional add-on instead.

  2. Select Save.

Optional Settings with Product becomes free when added to cart checked and highlighted

Step 3: Add the gift block in the Checkout Editor

  1. Open the Shopify Checkout Editor. Under Order summary, select Add block.

Checkout Editor Order summary with Add block highlighted
  1. Search gift and, under Checkout Plus, pick Auto Add Product (Gift with Purchase).

Checkout Plus Auto Add Product (Gift with Purchase) block highlighted
Auto Add Product (Gift with Purchase) block added under Order summary
  1. Optional: under Checkout behavior, turn on Include block in Shop Pay.

  2. Select Save.

Include block in Shop Pay turned on and the Save button highlighted

Step 4: Test your free gift

  1. In the checkout preview, enter your code (like FREEGIFT) in Discount code or gift card and select Apply.

FREEGIFT entered in the discount code field
  1. Your gift is added to the order marked FREE, with the code tag showing.

  2. Remove the code and check that the gift is removed too.

  3. Check both mobile and desktop checkouts.

Gift product added as FREE with the FREEGIFT tag

Do the codes need to match?

Yes. The Discount Code in Discount Plus and the Discount Code (exact) in Checkout Plus must match exactly. If they don't, the gift won't be added.

What if the gift isn't free?

Checkout Plus only adds the gift automatically when it becomes free from the discount code. If it isn't free, it's offered to the customer as an optional add-on instead.

What happens if the customer removes the code?

With Remove gift from cart when condition is not met (recommended) checked, the gift is removed when the code is removed. Only remove if added by this app keeps the product in the cart if the customer added it themselves.

Troubleshooting

  • No gift at all: check that you're on a Shopify Plus store, both apps are installed, and the Auto Add Product (Gift with Purchase) block is added in the Checkout Editor and saved.

  • The gift isn't added when the code is entered: check that the codes match exactly in both apps and the customization's Status is Active.

  • The gift is offered instead of added: the gift isn't free yet. Check that the same product is picked in both apps and Product becomes free when added to cart (with automatic discount codes) is checked.

  • The gift stays after the code is removed: check Remove gift from cart when condition is not met (recommended).

Need help? Message us from either app (click Contact Us in Checkout Plus or Contact us in Discount Plus) and tell us what gift offer you're setting up.

Ready to try it? Install Checkout Plus and Discount Plus from the Shopify App Store.

Did this answer your question?