Discount Code Standard Operating Procedure
Last updated: 2026-05-11
This document covers our discounting strategy following the migration from Shopify Scripts to Shopify Functions. Please read before creating or editing discount codes.
TL;DR โ Default Combinations by Discount Classโ
| Discount Class | Combine w/ Product | Combine w/ Order | Combine w/ Shipping |
|---|---|---|---|
| Order Discounts | โ | โ | โ |
| Shipping Discounts | โ | โ | โ |
| Product Discounts | โ | โ | โ |
Use these as defaults when creating new codes. Adjust per campaign as needed (e.g., shipping ร product is campaign dependent).
Background & Core Conceptโ
We migrated our automatic discounting logic (free swatches, sale prices, BFCM price matching, etc.) from Shopify Scripts to Shopify Functions. This introduces a new requirement that did not exist before:
For two discounts to stack, BOTH must be configured to combine with each other.
Under Scripts, our automatic discounts always ran regardless of discount code settings. Under Functions, discount codes must explicitly opt-in to combine with our Function via the combinesWith setting.
Every Shopify discount has a "Combinations" section that controls which other discounts it can stack with. There are three classes:
| Class | Examples |
|---|---|
| Product discounts | Our Discount Function (free swatches, sale prices, BFCM), product-specific codes (TIEONEON) |
| Order discounts | "20% off your order" codes, dollar-off-cart codes |
| Shipping discounts | "Free shipping" codes, "$5 off shipping" codes |
Each discount opts-in (or out) of combining with any of these classes.
Going-Forward Discount Code Rulesโ
Why these defaults: Our Discount Function is a Product Discount. For codes to coexist with our automatic discounts (sales, free swatches, BFCM), they must combine with product discounts.
Order Discounts (e.g., "20% off your order")โ
โ Combine with product discounts: YES
โ Combine with shipping discounts: YES (per campaign)
โ Combine with order discounts: NO
Shipping Discounts (e.g., "Free shipping")โ
โ Combine with product discounts: YES
โ Combine with order discounts: YES (per campaign)
โ Combine with shipping discounts: NO
Product Discounts (e.g., "$10 off this specific item")โ
โ Combine with product discounts: YES
โ Combine with order discounts: NO
โ Combine with shipping discounts: YES (per campaign)
What Happens When combinesWith Is Disabledโ
If a discount code lacks the necessary combinesWith setting, only one discount applies โ Shopify picks whichever gives the customer the better deal:
| Scenario | Outcome |
|---|---|
| Function โฅ Code | โ Function applies. Code is silently ignored. |
| Code > Function | โ ๏ธ Code applies. Function is overridden. |
Implication: A customer might apply a valid code at checkout and see no discount appear โ this is the expected behavior when our Function is already giving them more value. This is also why disabling combinesWith on an order code can silently override our automatic sale prices.
Example: How Stacking Plays Outโ
Scenario: Customer has a dress in their cart with a price of $129 and a compareAtPrice of $99 (the sale price). Our Function reads the compare-at-price and applies a $30 discount, bringing the line total from $129 down to $99.
The customer tries to apply an order discount code at checkout. Behavior depends on the code's value and its combinesWith setting:
| Code | combinesWith.productDiscounts | Result |
|---|---|---|
SAVE10 (10% off order) | โ enabled | Both apply: $99 sale price (after Function), then 10% off order โ $89.10 final |
SAVE10 (10% off order) | โ disabled | Function discount ($30) > Code discount ($12.90). Function wins. Customer pays $99. SAVE10 does not apply. |
SAVE50 (50% off order) | โ disabled | Code discount ($64.50) > Function discount ($30). Code wins. Customer pays $64.50 ($129 ร 0.5). Function's sale discount is not applied. |
The takeaway: with combinesWith enabled, customers get the best of both. Without it, they only get one โ and which one depends on the math.