Set up a buy two, get half price discount in Shopify
Buy X, get Y does not have to give the item away free: the get item can be half price instead. This tutorial sets up BUY2HALF, a code that gives 50% off the third item in the Trail Gear collection, running 11 to 30 November 2026.
Written · Shopify admin, desktop steps · 4 minutes read
The worked example
| Code | BUY2HALF |
| Offer | Buy 2, get 1 at 50% off |
| Applies to | Trail Gear collection |
| Active | 11 to 30 November 2026 |
| 3 items, $120.00 | $20.00 off, pays $100.00 |
| 6 items, $240.00 | $40.00 off, pays $200.00 |
Download the planner: buy-x-get-y-percentage-worksheet.csv (142 bytes).
A worksheet for the worked example carts: how many items, what the half-price item saves, 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 BUY2HALF. To generate a random discount code, click Generate code.
3Set what the customer buys
In the Customer buys section, select Minimum quantity of items and set the number to 2. In the Any items from section, select Specific collections and add the Trail Gear collection.
4Set what the customer gets
In the Customer gets section, set the quantity to 1. In the Any items from section, select Specific collections and add the Trail Gear collection. In the At a discounted value section, select Percentage and enter 50. The other choices are Amount off each and 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
Each set of two bought items gives one item at half price.
| Items | Cart total | 50% off one | Pays |
|---|---|---|---|
| 3 x $40.00 | $120.00 | $20.00 | $100.00 |
| 4 x $40.00 | $160.00 | $20.00 | $140.00 |
| 6 x $40.00 | $240.00 | $40.00 | $200.00 |
Four items give one item at half price, not two: the offer applies once per set of three. The percentage discount halves the price of the item in the Customer gets part.
Held at the counter
The customer must add the discounted item by hand. The free or discounted get item is never automatically added to the cart. A customer who buys two items and never adds the third gets no discount at all.
Percentage is one of three values. In the At a discounted value section, the choices are Percentage, Amount off each, or Free. Pick the one that matches the offer: a percentage halves the item, an amount off each takes a dollar value off it, and Free takes it to $0.
Watch the stock of the discounted item. If the item in the Customer gets part sells out, customers cannot take the discount. Check stock before launch.
Sources
- Buy X get Y discounts — Shopify's help pages: the create-a-Buy-X-get-Y-code steps, the At a discounted value choices, and the rule that the get item is never added automatically.