Set up a spend and get discount in Shopify
Buy X, get Y has a second variation: instead of buying a set quantity, the customer spends a set amount to get the discount. This tutorial sets up SPEND75, a code that gives a free hat when the customer spends $75 on tees, running 11 to 30 November 2026.
Written · Shopify admin, desktop steps · 4 minutes read
The worked example
| Code | SPEND75 |
| Offer | Spend $75 on tees, get a hat free |
| Gets value | $25.00 hat |
| Active | 11 to 30 November 2026 |
| Tees $80 + hat $25 | $25.00 off, pays $80.00 |
| Tees $70 + hat $25 | No discount, pays $95.00 |
Download the planner: spend-and-get-worksheet.csv (155 bytes).
A worksheet for the worked example carts: the tee total, the hat, and what the customer pays.
1Open Discounts and start a new discount
From your Shopify admin, go to Discounts, then click Create discount. In the Select discount type menu, click Buy X get Y from the list.
2Choose the code method
In the Method section, select Discount code. In the Discount code field, enter a name for the code, for example SPEND75. To generate a random discount code, click Generate code.
3Set what the customer spends
In the Customer buys section, select Minimum purchase amount and set the amount to 75. In the Any items from section, select Specific collections and add the Tees collection. Only tee purchases count toward the $75.
4Set what the customer gets
In the Customer gets section, set the quantity to 1. In the Any items from section, select Specific products and add the Trail Hat. In the At a discounted value section, select Free.
5Set who can use it
In the Eligibility section, choose which customers can use the discount. Select All customers for a public code. The other choices are Specific customers, Customer segments, and Markets.
6Set the dates
In the Active dates section, set the start date to 11 November 2026 and click Set end date to set the end date to 30 November 2026. If you do not set an end date, the code does not expire. Start and end times follow the time zone set in your Shopify admin.
7Save
Click Save to create the discount. The code appears on the Discounts page and is ready to use.
The arithmetic
Only the Customer buys products count toward the $75.
| Cart | Total | Hat free | Pays |
|---|---|---|---|
| Tees $80.00 + hat $25.00 | $105.00 | $25.00 | $80.00 |
| Tees $70.00 + hat $25.00 | $95.00 | $0.00 | $95.00 |
| Tees $120.00 + hat $25.00 | $145.00 | $25.00 | $120.00 |
Only the Customer buys products count toward the $75: the $25 hat does not count. A cart with $70 of tees and the hat is $5 short, even though the cart total is $95.
Held at the counter
The hat does not count toward the $75. Only the products in the Customer buys part count toward the minimum purchase amount. The get item's price never helps reach the threshold.
The customer must add the hat by hand. The free or discounted get item is never automatically added to the cart. A customer who spends $80 on tees and never adds the hat gets no discount at all.
The minimum counts product prices only. Shipping costs and taxes are never included in the amount. A cart with $70 of tees and $8 shipping is still $5 short.
Sources
- Buy X get Y discounts — Shopify's help pages: the two variations of Buy X get Y, the minimum purchase amount rules for the Customer buys part, and the rule that the get item is never added automatically.