Quantity Logic
Configure quantity-based discounts including BOGO offers, item limits, and selection order to create sophisticated promotional rules.
Quantity Logic
Quantity logic settings let you control which items get discounted based on quantity rules. Use these settings to create “Buy One Get One” offers, limit discounts to specific quantities, and control which items receive the discount first.
Quantity Logic Options
Apply to All / Apply to Quantity
Limit the discount to a specific number of items per cart line.
Configuration:
- Apply to all: Discount applies to every matching item
- Apply to quantity: Enter the number of items to discount in “Quantity (per cart line)”
Example: “First 5 items get 20% off”
- Set quantity to 5
- Customer buys 8 items → 5 get 20% off, 3 at full price
Use cases:
- Limited quantity promotions
- “First X items” deals
- Controlling discount exposure
Discount Every Nth Item
Create “Buy One, Get One” style offers where specific items in a sequence get discounted.
Configuration:
- Enter the interval number (2 for every 2nd item, 3 for every 3rd item, etc.)
Examples:
| Setting | Effect | Common Name |
|---|---|---|
| Every 2nd item | Buy 1, Get 1 discounted | BOGO |
| Every 3rd item | Buy 2, Get 1 discounted | B2G1 |
| Every 4th item | Buy 3, Get 1 discounted | B3G1 |
How it works:
- Items are counted in order
- Only the Nth item receives the discount
- Pattern repeats for additional items
Example: Every 2nd item at 50% off, customer buys 5 items:
- Item 1: Full price
- Item 2: 50% off
- Item 3: Full price
- Item 4: 50% off
- Item 5: Full price
Buy X, Get Y Discounts
Require purchases from one product group to unlock discounts on another group.
Configuration:
- Buy From Groups: Select the group customers must buy from
- Cart Line Groups: Select the group that receives the discount
Example: “Buy 2 shirts, get 1 accessory 50% off”
- Buy From Groups: Shirts
- Cart Line Groups: Accessories
- Discount: 50% percentage
- Quantity logic: As needed
Use cases:
- Cross-sell promotions
- Category-to-category offers
- Encouraging product discovery
Item Selection Order
When discounts apply to limited quantities, this setting determines which items get discounted first.
Default Order
Items are processed as they appear in the cart.
When to use:
- Order doesn’t matter for your promotion
- Simple promotions without price-based logic
Cheapest First
Discount the lowest-priced items first.
When to use:
- BOGO where you want to discount the cheaper item
- “Free gift” promotions (the cheapest item becomes free)
- Maximizing number of discounted items within a budget
Example: “Buy 1, Get 1 Free” with Cheapest First
- Customer adds $50 shirt and $30 shirt
- The $30 shirt is free (cheapest first)
- Customer pays $50
Most Expensive First
Discount the highest-priced items first.
When to use:
- Premium promotions highlighting big savings
- When you want customers to feel they’re getting the best deal on expensive items
- Marketing focused on “save $X” messaging
Example: “Buy 1, Get 1 50% Off” with Most Expensive First
- Customer adds $50 shirt and $30 shirt
- The $50 shirt gets 50% off ($25 savings)
- Customer pays $30 + $25 = $55
Item Limits
Set a maximum number of line items that can receive the discount.
Configuration:
- Enter the maximum number of items
- Leave blank for unlimited
Example: “Up to 3 items get 30% off”
- Set item limit to 3
- Customer adds 5 qualifying items → 3 get 30% off, 2 at full price
Use cases:
- Limiting promotion exposure
- “Up to X items” deals
- Preventing excessive discounting on large orders
Item Limit vs. Quantity Per Cart Line
These two settings control different aspects of quantity limiting:
Item Limit
Limits the number of cart line items that receive the discount from the selected cart line group.
Example: Item limit of 2 with 3 different products in cart:
- Product A (qty 5): Discounted
- Product B (qty 3): Discounted
- Product C (qty 2): NOT discounted (limit reached)
Quantity (Per Cart Line)
Limits the number of units discounted within each cart line.
Example: Quantity of 2 per cart line:
- Product A (qty 5): 2 discounted, 3 at full price
- Product B (qty 3): 2 discounted, 1 at full price
- Product C (qty 2): 2 discounted
Combined Example
Item Limit: 2, Quantity per cart line: 3
- Product A (qty 5): 3 discounted (line 1 of 2)
- Product B (qty 4): 3 discounted (line 2 of 2)
- Product C (qty 3): NOT discounted (item limit reached)
Common BOGO Configurations
Buy 1, Get 1 Free
- Discount Type: Percentage
- Value: 100
- Quantity Logic: Every 2nd item
- Item Order: Cheapest First
- Message: “Buy one, get one free!”
Buy 1, Get 1 50% Off
- Discount Type: Percentage
- Value: 50
- Quantity Logic: Every 2nd item
- Item Order: Most Expensive First (customer gets bigger discount on expensive item)
- Message: “Buy one, get one {{percentage}} off!”
Buy 2, Get 1 Free
- Discount Type: Percentage
- Value: 100
- Quantity Logic: Every 3rd item
- Item Order: Cheapest First
- Message: “Buy 2, get 1 free!”
Buy Any 2, Get Accessory Free
- Discount Type: Percentage
- Value: 100
- Quantity Logic: Buy X, Get Y
- Buy From Groups: Main Products
- Cart Line Groups: Accessories
- Message: “Free accessory with any 2 items!”
Advanced Patterns
Tiered BOGO
Combine with tiered pricing for volume-based BOGO:
- Buy 2-4: Get every 3rd item 25% off
- Buy 5-9: Get every 3rd item 50% off
- Buy 10+: Get every 3rd item free
Category Cross-Sell
Use Buy X, Get Y with specific groups:
- Buy from “Shoes” group → Discount “Socks” group
- Buy from “Laptops” group → Discount “Accessories” group
Limited Premium Discount
Combine item limits with item selection order:
- Item Limit: 1
- Item Order: Most Expensive First
- Result: Only the most expensive item gets discounted
Troubleshooting
BOGO Not Applying Correctly
- Verify you have enough items in cart (need 2 items for every 2nd item discount)
- Check that items belong to the correct cart line group
- Confirm item selection order is set as expected
Wrong Items Getting Discounted
- Check item selection order (Cheapest First vs Most Expensive First)
- Verify cart line group membership
- Review quantity limits
Discount Applying to Too Many/Few Items
- Review both Item Limit and Quantity per cart line settings
- Check if multiple discount rules are interacting
- Test with exact quantities at boundaries
Related Documentation
- Basic Discount Settings - Discount types and strategies
- Cart Line Groups - Organizing products for targeted discounts
- Metafield Discounts - Dynamic discount values
- Tiered Pricing - Volume-based discount tiers