---
title: "How OneCode decides which discounts apply"
description: "When a OneCode discount has several discount types, product discounts give each item its best price, only the biggest order discount applies, and shipping discounts apply to the rates they target."
url: https://docs.onecodediscounts.com/en/articles/4-how-onecode-decides-which-discounts-apply
collection: "Getting started"
updated: 2026-11-06
language: en
---

# How OneCode decides which discounts apply

When a OneCode discount has several discount types, product discounts give each item its best price, only the biggest order discount applies, and shipping discounts apply to the rates they target.

**In short:** Inside one OneCode discount, every item gets the single best product discount it qualifies for, only the order discount that saves the most is used, and each shipping discount applies to the rates it targets. Product, order and shipping discounts from the same code all apply together.

## Step by step

When a customer's cart or checkout changes, OneCode: Stackable Discounts checks the discount in this order:

1.  **Global Conditions.** Every global condition must be met. If even one isn't, nothing in this discount applies.
    
2.  **Each discount type on its own.** OneCode checks each discount type's target, exclusions and **Per-Discount Conditions** separately. A discount type that doesn't qualify is simply skipped. The others still apply.
    
3.  **Pick the winners:**
    
    -   **Product discounts:** if two or more product discount types would discount the same item, the item gets the one that saves the most. They aren't added together.
        
    -   **Order discounts:** if two or more order discount types qualify, only the one that saves the most is applied.
        
    -   **Shipping discounts:** each shipping discount type applies to the shipping rates it targets.
        
4.  **Apply them together.** The winning product, order and shipping discounts all apply at the same time.
    

## Worked example: tiers don't add up

A discount has three product discount types on the same collection, each with a **Cart Quantity** condition (the number of items in the whole cart):

-   10% off when the cart has 2 or more items.
    
-   15% off when the cart has 3 or more items.
    
-   20% off when the cart has 4 or more items.
    

A customer adds 3 items. Both the 10% and the 15% qualify, so each item gets 15% off. It does not get 25%. With 4 items, each item gets 20%.

This "best one wins" rule is what makes tiered discounts easy to build. See [Buy more, save more: quantity tiers](https://jxngqfpxd.us.gleap.help/en/articles/28).

## Worked example: product plus order plus shipping

A code has 20% off the Summer Collection, $10 off the order and free shipping. A customer buys a $50 Summer Collection shirt and a $30 accessory:

-   The shirt gets 20% off: $10 saved.
    
-   The order gets $10 off. Shopify takes order discounts off the subtotal after product discounts, so it comes off the $70 left.
    
-   Shipping is free.
    

## Good to know

-   Discounts in the same OneCode discount always work together. How they combine with **other** discounts in your store depends on the **Combinations** setting. See [How OneCode discounts combine with your other discounts](https://jxngqfpxd.us.gleap.help/en/articles/20).
    
-   If two product discount types save exactly the same amount on an item, the one higher in the list is used.
    
-   Shipping is different between separate discounts: Shopify applies only one shipping discount per order. If a customer has two different shipping discounts, Shopify uses the one that saves the most.
    
-   For the customer's side of this, see [Why did only one discount apply?](https://jxngqfpxd.us.gleap.help/en/articles/37).

## Related

- [What is OneCode?](https://docs.onecodediscounts.com/en/articles/1-what-is-onecode.md)
- [How much does OneCode cost?](https://docs.onecodediscounts.com/en/articles/2-how-much-does-onecode-cost.md)
- [Create your first OneCode discount](https://docs.onecodediscounts.com/en/articles/3-create-your-first-onecode-discount.md)
- [Create and edit discounts with Sidekick](https://docs.onecodediscounts.com/en/articles/41-create-and-edit-discounts-with-sidekick.md)
