Skip to main content

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 ClassCombine w/ ProductCombine w/ OrderCombine 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:

ClassExamples
Product discountsOur 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:

ScenarioOutcome
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:

CodecombinesWith.productDiscountsResult
SAVE10 (10% off order)โœ… enabledBoth apply: $99 sale price (after Function), then 10% off order โ†’ $89.10 final
SAVE10 (10% off order)โŒ disabledFunction discount ($30) > Code discount ($12.90). Function wins. Customer pays $99. SAVE10 does not apply.
SAVE50 (50% off order)โŒ disabledCode 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.