Set up a buy from one collection, get from another discount in Shopify
The buys side and the gets side of a buy X, get Y discount can come from different collections. This tutorial sets up TRAILGIFT, a code that gives one free accessory from the Accessories collection with every two items from the Trail Gear collection, running 11 to 30 November 2026.
Written · Shopify admin, desktop steps · 5 minutes read
The worked example
| Code | TRAILGIFT |
| Buys | 2 items from Trail Gear |
| Gets | 1 item free from Accessories |
| Active | 11 to 30 November 2026 |
| 2 trail $35 + accessory $15 | $15.00 off, pays $70.00 |
| Accessory only, $15.00 | No discount |
Download the planner: collection-to-collection-worksheet.csv (167 bytes).
A line-by-line worksheet for the worked example cart: which lines the code covers and what each line costs after the discount.
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 TRAILGIFT. 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. Only items from that collection count as buy items.
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 Accessories collection. 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
The discount applies to the accessory only, at its price.
| Item | Price | Free | Pays |
|---|---|---|---|
| Trail Pack (Trail Gear) | $35.00 | $0.00 | $35.00 |
| Trail Bottle (Trail Gear) | $35.00 | $0.00 | $35.00 |
| Trail Cap (Accessories) | $15.00 | $15.00 | $0.00 |
| Total | $85.00 | $15.00 | $70.00 |
An accessory on its own does not start the offer: the Customer buys part has to be met first. The offer can repeat: one free accessory for each set of two trail items, so four $35 trail items and two $15 accessories cost $170 minus $30, which is $140.
Held at the counter
The customer must add both parts by hand. The free or discounted get item is never automatically added to the cart. A customer who buys two trail items and never adds an accessory gets no discount at all.
The buys and the gets come from different lists. An accessory in the cart does not help meet the buys side, and a trail item does not count as a get item. Each side is checked against its own collection.
Watch the stock of the free collection. If the accessories run out, the free item shows as sold out and customers cannot take advantage of 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 Any items from sections for buys and gets, and the rule that the get item is never added automatically.