Create Tiered Pricing
Route discounts to different branches based on cart quantity, spend, or a custom numeric field.
Overview
The Define Tiers block evaluates items in your cart against defined thresholds and routes to different discount logic based on which tier is met. Items that qualify for a tier are automatically grouped as Matched Items for use by connected discount blocks.
- Volume discounts — more items bought, bigger discount
- Spend thresholds — more money spent, bigger discount
- Loyalty or weight-based tiers — drive tiers from a custom numeric field
- Discount-aware tiers — fair thresholds even when other discounts are stacked
- Full-price-only tiers — reward spend on non-discounted items
Setup
Open your discount function
Navigate to the function you want to edit in Function Studio
Add the Define Tiers block
Click Add Action and select Define Tiers from the action list
Pick a Tier type
Choose how thresholds are measured
Set Group by
Optionally evaluate per product, variant, line item, or custom field
Select cart line groups
Choose which line item groups feed into the tier calculation
Add tier definitions
Use Add tier — each tier exposes its own output handle on the block
Connect discount blocks
Wire each tier output to the discount action that should run when that tier qualifies
Settings
Tier type
Required
Choose how thresholds are measured. See Tier Types Explained for the full behavior of each option.
- Quantity-based — counts item quantity
- Cart total / Group total — sums discounted price × quantity
- Cart total + discount / Group total + discount — spend-based, with thresholds auto-adjusted by discounts already applied (only available when Group by is None)
- Cart total - discounted items / Group total - discounted items — sums the original price of items that have no discount applied (only available when Group by is None)
- Custom Field Based — sums a custom numeric field × quantity
Group by
Optional
Choose how to group items when evaluating tiers. Hidden when Tier type is Cart total + discount or Cart total - discounted items (those always evaluate the whole cart).
- None (evaluate all items together) (default) — all matched items are totalled together, and one tier is chosen for the whole pool
- Product (evaluate each product separately) — each product qualifies for its own tier independently
- Variant (evaluate each variant separately) — each variant qualifies independently
- Line Item (evaluate each cart line separately) — each cart line is evaluated on its own
- Custom field (group by any field value) — items sharing the same value for Group by field are evaluated together
Custom grouping configuration
Required when Group by is set to Custom field
Appears when Group by is set to Custom field. Items with the same field value are grouped together for tier evaluation — useful for applying quantity tiers per unique line item property or per metafield value.
Group by field
Select which field to use for grouping items. Items sharing the same value for this field will be evaluated together. Supports product/variant metafields, cart attributes, and line item attributes.
Field for tier calculation
Required for Custom Field Based tier type
Select which numeric field to use for determining tier thresholds. Supports product/variant metafields, cart attributes, and line item attributes.
Note
This value is multiplied by the line item quantity when summed across cart lines.
Cart line groups
Required
Select which groups to check for tier thresholds. Items from all selected groups are combined into a single pool before evaluation — duplicate items (same line in multiple groups) are counted once. Leave empty to check all items in the cart.
Tier definitions
Required
Add one or more tiers using Add tier. Each tier needs:
- Minimum quantity (shown for Quantity-based) or Minimum amount (shown for all other tier types) — the threshold the total must reach. For Quantity-based this is a count; for amount-based types it’s a number in shop currency; for Custom Field Based it’s in the field’s unit.
- Each tier exposes its own output handle on the block for connecting to a downstream discount action.
A tier with a minimum of 0 acts as a fallback branch — it runs when no other tier qualifies, including when the group is empty. Use this for default messaging or baseline logic.
Tier Types Explained
Each tier type changes what gets measured to decide which tier qualifies. Thresholds are always compared against this measured total.
Quantity-based
Counts the total quantity of matched items.
Buy 3 items → 10% off. Buy 5 → 20% off. Buy 10 → 30% off.
The threshold is a plain item count (Minimum quantity).
Cart total / Group total
Sums discounted price × quantity across matched items — i.e., what the customer actually pays after any discounts already applied earlier in the flow.
Spend $100 → 10% off. Spend $200 → 15% off.
Because the total is discount-aware, stacking discounts won’t artificially push a customer into a higher tier. The label reads Cart total when no cart line groups are selected, and Group total when groups are selected.
Custom Field Based
Sums a custom numeric field across matched items, multiplied by line quantity.
Field = weight per unit (2 kg), customer buys 3 units → contributes 6 kg to the tier total.
The formula per line is:
line_contribution = field_value × line.quantity
Use this for tiers based on weight, volume, loyalty points, credits, or any numeric attribute you track on line items.
Cart total + discount / Group total + discount
A discount-aware variant of Cart total. The tier thresholds are internally raised by the total discount already given, so customers aren’t penalized for other active discounts.
Original subtotal $100. Other discounts took $20 off. A “Spend $90” tier internally becomes “Spend $110”, so the $80 discounted total still qualifies.
Use this when you want thresholds phrased against the original pre-discount value but applied consistently against the customer’s actual cart total. Only available when Group by is None.
Cart total - discounted items / Group total - discounted items
Sums the original price of items that have no discount applied. Items that already received any discount earlier in the flow are excluded entirely from the total.
Spend $50 on full-price items → 10% off. Items on sale don’t count toward the threshold.
Use this to reward customers for buying regular-price products without letting promotional items inflate the total. Only available when Group by is None.
Note
Shopify Functions can see only discounts applied inside the same function. So you need to consolidate all the discounts that you need to account for in the tier minimum calculation inside the same function.
How It Works
Collect items
All items from the selected groups are pooled and deduplicated by line ID
Measure the total
The tier type determines what’s measured (quantity, discounted amount, custom field, etc.)
Sort tiers
Tiers are sorted highest-to-lowest by minimum
Pick the highest qualifying tier
The first tier whose minimum is met wins — lower tiers are skipped
Assign Matched Items
Qualifying items are tagged as Matched Items for connected discount blocks
Run the tier branch
The output for the winning tier executes; other outputs are skipped
When Group by is not None, steps 2–6 repeat independently for each group (per product, per variant, per line, or per custom key), and every qualifying group runs its tier branch with its own Matched Items.
Examples
Volume Discount
Reward larger orders with progressively deeper discounts.
Tier type
Quantity-based
Cart line groups
All cart items
Tiers
5 → 10% off, 10 → 15% off, 20 → 20% off
Result
Customer buying 12 items qualifies for the 15% tier
Spend Threshold
Apply a discount once cart value crosses a line.
Tier type
Cart total
Cart line groups
All cart items
Tiers
$50 → 5% off, $100 → 10% off, $200 → 15% off
Result
Customer with $120 in the cart qualifies for the 10% tier
Weight-Based Discount (Custom Field Based)
Reward heavier orders using a weight metafield.
Tier type
Custom Field Based
Field for tier calculation
product.metafields.shipping.weight
Tiers
10 → $5 off, 25 → $15 off
Result
3 units of a 4 kg product = 12 kg total → qualifies for the $5 tier
Fair Tiers With Stacked Discounts
Keep your spend thresholds honest when another promotion is already running.
Tier type
Cart total + discount
Tiers
$90 → 5% off, $180 → 10% off
Result
A cart with $100 in items and a $20 discount already applied still qualifies for the $90 tier — the threshold self-adjusts
Full-Price-Only Spend Tier
Only count products sold at full price toward the threshold.
Tier type
Cart total - discounted items
Tiers
$50 → 10% off
Result
A cart with $40 full-price items and $30 in sale items does not qualify — only the $40 counts
Per-Product Evaluation
Apply quantity tiers independently to each product in the cart.
Tier type
Quantity-based
Group by
Product (evaluate each product separately)
Tiers
3 → 10% off, 5 → 20% off
Result
4 units of Product A and 6 units of Product B → A qualifies for the 10% tier, B qualifies for the 20% tier, each with its own Matched Items
Best Practices
Picking the Right Tier Type
- Cart total / Group total — standard spend thresholds. Discount-aware, so safe with stacked discounts.
- Custom Field Based — anything measured in units other than count or currency (weight, points, calories).
- Cart total + discount — when threshold copy should read against the original subtotal.
- Cart total - discounted items — when sale items should not count toward the threshold.
Grouping
- Use None when the whole cart is one promotion.
- Use Product or Variant for “buy 3 of the same item” mechanics.
- Use Line Item when each cart line is an independent unit (rare but useful for subscription or configurator carts).
- Use Custom field with a bundle ID or collection field to gate tiers per bundle or per category.
Important Considerations
Note
Tier minimums for Cart total, Cart total + discount, and Cart total - discounted items are in shop default currency. Enable currency conversion if you sell to multiple markets and want to manage tier minimums in the default currency.
Caution
For Cart total and Cart total + discount, the total is computed using prices after discounts from earlier blocks in the flow.
Troubleshooting
Tier not triggering
- Confirm the selected cart line groups actually contain items
- For Custom Field Based, verify the field resolves to a number — non-numeric values contribute
0 - For Cart total - discounted items, remember that any item with a prior discount is excluded
Wrong tier qualifying
- Inspect whether an earlier block applied a discount that pushed the Cart total below the next threshold — consider Cart total + discount instead
- Check the Group by setting — per-product grouping evaluates each product independently, not the whole cart
Related Actions
- Count Items — count items in groups for simple quantity conditions
- Sum Values — sum a numeric field across items without tier routing
- Define Cart Line Groups — build the groups used as tier input