The request, almost word for word: “Create ONE discount code that applies different percentage discounts based on product collections. 20% off the sale20 collection, 15% off sale15, and 10% off sale10. Each product gets only one discount, the highest one. Don’t create three separate codes.”
That’s one of the most common specs merchants bring to us from ChatGPT. The logic below is the real discount our AI Discount Generator built for it and the merchant saved.
Why native Shopify discounts can’t do this
A Shopify discount code has one value. To give three rates you’d need three codes, and you’d have to explain to shoppers which code goes with which collection. Shopify lets customers enter more than one code if you allow combinations, but you can’t make them enter the right one, and you can’t stop a product in two collections from picking up the bigger rate by accident or stacking.
How the logic works
The discount is a chain of checks. Every line in the cart walks down it and stops at the first match:
- In sale20? 20% off.
- Otherwise, in sale15? 15% off.
- Otherwise, in sale10? 10% off.
- Otherwise, no discount.
Because the highest rate is checked first, a product in both sale20 and sale10 gets 20%, never both.
Build it with the AI Discount Generator
The fastest way. On the Regios Discounts home page, click Create discount and paste this prompt into the AI box, swapping in your own collection, product, and brand names:
Create one discount code, VIP. 20% off products in the sale20 collection, 15% off sale15, and 10% off sale10. If a product is in more than one of these collections, apply only the highest discount. Products outside these collections get no discount.
We ran this exact prompt through the generator, and it builds the same logic as the JSON below. Review the steps it creates, link your own products or collections, and save.
Build it from scratch in the app
Step 1. Install Regios Discounts and open it. On the home page, click Create discount.
Step 2. Under Prefer not to use AI?, click Start from scratch.
Step 3. Choose Amount off product.
Step 4. Under How will customers get this discount?, choose With a discount code. Enter the code, such as VIP. On code discounts the code is also the title customers see.
Step 5. Scroll to Discount steps and click Review discount steps. In the dialog, pick Start from scratch and click Next. You’ll see a Discount type box with a Then button.
Step 6. Click Then and choose Check if. Click Add criteria, pick Collection, and click Add criteria.
Step 7. Click Search collections, select your highest-discount collection (sale20), click Add, then Save criteria.
Step 8. On that check, click Then, choose Apply discount, and enter 20 as the percentage.
Step 9. Click Otherwise on the first check and add another Check if for the next collection (sale15). Its Then gets Apply discount at 15.
Step 10. Repeat once more from the second check’s Otherwise: a check for sale10 and Apply discount at 10. Leave the last Otherwise empty so other products get nothing.
Step 11. Click Done, then Save. Order matters: put the highest discount first, so a product in two collections stops at the bigger one.
Or import the logic
Prefer to skip the clicking? Create the discount as in steps 1 to 4 above, then click Logic at the top of the discount form, choose Import, and use the JSON below. The JSON import guide walks through each screen. Link sale20, sale15, and sale10 to your own collections when the app asks.
Ready-to-import discount logic
Copy the JSON below into Regios Discounts using the import flow, or download this file. Step-by-step: how to import discounts from JSON files (home screen, Logic > Import, choosing discount type, linking missing resources, and saving).
Want to describe what you need in plain language instead? Our AI Discount Generator covers prompts, iterating on results, linking products/collections when the app asks, and using or exporting the logic.
{
"id": "<root>",
"type": "ROOT",
"entryPoint": {
"id": "check-if-sale20",
"then": {
"id": "apply-discount-sale20",
"type": "APPLY_DISCOUNT",
"title": "20% off sale20",
"value": {
"type": "PERCENTAGE",
"percentage": "20"
}
},
"type": "CHECK_IF",
"matchType": "AND",
"otherwise": {
"id": "check-if-sale15",
"then": {
"id": "apply-discount-sale15",
"type": "APPLY_DISCOUNT",
"title": "15% off sale15",
"value": {
"type": "PERCENTAGE",
"percentage": "15"
}
},
"type": "CHECK_IF",
"matchType": "AND",
"otherwise": {
"id": "check-if-sale10",
"then": {
"id": "apply-discount-sale10",
"type": "APPLY_DISCOUNT",
"title": "10% off sale10",
"value": {
"type": "PERCENTAGE",
"percentage": "10"
}
},
"type": "CHECK_IF",
"matchType": "AND",
"otherwise": null,
"conditions": [
{
"type": "PRODUCT_ELIGIBILITY",
"eligibility": {
"type": "SPECIFIC_COLLECTIONS",
"asListOfIds": "sale10",
"selectedCollections": []
},
"includeOrExclude": "INCLUDE"
}
]
},
"conditions": [
{
"type": "PRODUCT_ELIGIBILITY",
"eligibility": {
"type": "SPECIFIC_COLLECTIONS",
"asListOfIds": "sale15",
"selectedCollections": []
},
"includeOrExclude": "INCLUDE"
}
]
},
"conditions": [
{
"type": "PRODUCT_ELIGIBILITY",
"eligibility": {
"type": "SPECIFIC_COLLECTIONS",
"asListOfIds": "sale20",
"selectedCollections": []
},
"includeOrExclude": "INCLUDE"
}
]
}
}
Frequently asked questions
What if a product is in two of the collections?
It gets the highest rate only. The logic checks the 20% collection first, then 15%, then 10%, and stops at the first match, so nothing is double-discounted.
Can I use product tags or product types instead of collections?
Yes. Each step is a product condition, so you can swap a collection for a tag, product type, or vendor in the logic builder.
Can I add an "everything else" rate?
Yes. Add one more step at the end of the chain with no product condition (or with your sale collections excluded). Products that didn’t match any earlier step fall through to it.
Does the customer see one discount or three at checkout?
One code. Each line shows the discount its collection earned, and you can give each step its own title, such as “20% off sale20.”