Gift with purchase by discount code
A Gift with purchase discount can be a discount code instead of an automatic discount. The gift is then free only for customers who enter the code. This page covers how a gift code behaves, and how to have the gift added for the customer.
Create a gift code
Section titled “Create a gift code”-
Create a Gift with purchase discount
Follow the setup steps to open a new one.
-
Choose Discount code as the method, and enter the code
-
Set the requirement and the gift
They work as they do for an automatic gift: see Settings.
-
Click Save
How a gift code behaves
Section titled “How a gift code behaves”A new gift code uses the Any matching product selection strategy. The gift is free when three things are true: the customer has entered the code, their cart meets the requirement, and the gift product is in the cart, however it got there.
Two things follow from that, and both surprise customers:
- Nothing adds the gift. An automatic gift is added to the cart for the customer. A code’s gift isn’t, so the customer has to add the gift product themselves.
- Shopify turns the code away while the gift isn’t in the cart. Shopify rejects a discount code that gives no discount, and a gift code gives its discount on the gift. A customer who enters the code first sees it rejected.
The Only products added via storefront or checkout widgets selection strategy takes care of both.
Have the gift added for the customer
Section titled “Have the gift added for the customer”Under Selection strategy, a discount code has the same two choices as an automatic gift:
- Only products added via storefront or checkout widgets has the gift added for the customer once the code is applied. Only that gift is free: the same product added by the customer themselves is paid for.
- Any matching product is the behaviour described above, and what a new code starts on.
With Only products added via storefront or checkout widgets chosen:
- The code is accepted before the gift is in the cart. It applies as an order discount of nothing until the gift is there. The cart and checkout show the code as applied, with nothing taken off yet.
- The gift is added in the cart when the code is on the cart and the cart meets the requirement: when the customer arrived through a shareable discount link, or as soon as they apply the code in your theme’s cart. This is done by the Gift with purchase app embed, as it does for automatic gifts. A choice of gifts opens the gift selector, when it is turned on. Taking the code off the cart takes the gift out again.
- The gift is added at checkout when the customer first enters the code there. This is done by the Gift with purchase checkout block, with its Add gifts automatically setting turned on. Checkout blocks need Shopify Plus. On a Plus store, the discount editor warns you while the block isn’t in your published checkout.
On a store without Shopify Plus, the gift is added in the cart only. A customer who first enters the code at checkout has it accepted, and no gift follows. If your customers mostly enter the code at checkout, Any matching product is the safer choice there.
What choosing it changes
Section titled “What choosing it changes”- The discount gets the
dk:livetag when you save it. The tag is what lets the checkout block and your storefront read a discount code. It also lists the discount in your Discount Kit Live data. Switching back to Any matching product leaves the tag in place, so remove it from the discount’s tags if you no longer want it. - The code stays private. Discount Kit Live data is public, so a discount with this strategy is listed without its code, and without its title when the title is the code. A customer gets the gift only by entering the code. If your theme lists every Discount Kit Live discount, this one shows with an empty title and code, so filter on its method.
- The discount counts as an order discount as well as a product discount when Shopify works out which discounts combine. Another discount has to combine with order discounts to be used alongside it.
Limits
Section titled “Limits”- A choice of gifts isn’t added at checkout. There the gift is added when the discount gives one product with one variant. Checkout has no gift selector yet.
- Only the discount’s own code brings the gift. The gift isn’t added for codes generated in bulk for the discount.
- Discounts for tagged customers, and discounts in test mode, aren’t added at checkout. Checkout doesn’t tell apps a customer’s tags.
- Spend requirements are only checked in your store’s currency at checkout, unless the discount sets its amounts in the customer’s currency. Quantity requirements work in every currency.
- Shopify doesn’t let apps change the order in accelerated checkouts such as Apple Pay and Google Pay, so the gift isn’t added there.
The checkout block’s own limits are listed under Gifts in checkout.