Unlike fulfillment constraints which block locations, cart routing rules prioritize locations. If the preferred location is out of stock, Shopify automatically falls back to the next available location.
Constraints vs Routing
How cart routing rules work
A cart routing rule has two parts:- When (condition): Which cart properties trigger the rule
- Then (groups): How to rank locations when triggered
Configure a cart routing rule
1
Access order routing settings
Go to Charlie → Settings → Order routing or Shopify → Settings → Shipping and delivery → Order routing.
2
Add the Cart Rules rule
Find Charlie’s Cart Rules and add it to your routing strategy.
3
Configure the condition (When)
Set up which cart properties trigger this rule:
Choose the appropriate operator and enter the value.
4
Configure location groups (Then)
Create ranked groups of locations. Group 1 has highest priority, Group 2 is the fallback, and so on.For each group, click Add selector and choose how to select locations:
5
Enable the rule
Toggle the rule to Enabled when you’re ready to apply it to live orders.
Condition types
- Total cart quantity
- Total cart amount
- Line item has attribute
Triggers based on the total number of items in the cart.Operators available:
Best for:
- Routing bulk orders to warehouses
- Preferring stores for single-item orders
Examples
Large orders prefer warehouse
A retailer wants orders with more than 10 items to prefer warehouse fulfillment for efficient bulk packing.1
Create the rule
- Condition: Total cart quantity
- Operator: Greater Than
- Value: 10
2
Configure groups (Then)
- Group 1: Location type = Warehouse
- Group 2: Location type = Store
High-value orders prefer secure locations
A jewelry retailer wants orders over €500 to prefer locations with secure handling and insurance.1
Tag secure locations
Add the tag
high-value-certified to locations with secure handling processes.2
Create the rule
- Condition: Total cart amount
- Operator: Greater Than
- Value: 500
3
Configure groups (Then)
- Group 1: Location tag =
high-value-certified - Group 2: Location type = Warehouse
- Group 3: Location type = Store
Gift-wrapped items prefer flagship stores
A fashion brand offers gift wrapping, and wants these items to prefer stores with premium packaging services.1
Tag capable stores
Add the tag
gift-wrap-capable to stores with gift wrapping services.2
Create the rule
- Condition: Line item has attribute
- Operator: Equal
- Attribute key:
gift_wrap - Attribute value:
true
3
Configure groups (Then)
- Group 1: Location tag =
gift-wrap-capable - Group 2: Location type = Store
- Group 3: Location type = Warehouse
Small orders prefer local stores
A retailer wants single-item orders to prefer nearby stores for faster delivery.1
Create the rule
- Condition: Total cart quantity
- Operator: Equal
- Value: 1
2
Configure groups (Then)
- Group 1: Location type = Store
- Group 2: Location type = Warehouse
Combining with constraints
For maximum control, combine routing rules with constraints:
Example: High-value order strategy
-
Fulfillment Constraint: Orders > €1000 → Include only locations tagged
insured→ Uninsured locations are blocked -
Cart Routing Rule: Orders > €500 → Prefer locations tagged
secure-packaging→ Secure locations are preferred among eligible locations
Combining with other routing rules
Cart rules work well with other routing rules:
Example setup:
- Cart Rules: Orders > 10 items → Prefer warehouses
- Inventory Rules: Among warehouses, prefer those with most stock
- Capacity Rules: Deprioritize locations near capacity
Best practices
Use quantity for operational efficiency
Route bulk orders to locations equipped for efficient multi-item packing.
Use amount for risk management
Prefer secure locations for high-value orders without blocking checkout.
Use attributes for special handling
Route items with special requirements to capable locations.
Combine with inventory rules
Add Inventory Rules to prefer locations with stock among the prioritized group.
Troubleshooting
Orders not routing to expected locations
Orders not routing to expected locations
Check:
- Is the rule enabled?
- Does the cart actually meet the condition? (Check quantity/amount/attributes)
- Does the preferred location have stock?
- Are there constraint rules blocking the location?
- Is another routing rule with higher priority overriding this one?
Line item attribute rule not triggering
Line item attribute rule not triggering
Check:
- Is the attribute key spelled exactly right? (Case-sensitive)
- Is the attribute actually being set on the line item? Check the cart data in your theme.
- For “Equal” operator, does the value match exactly?
Wrong group being selected
Wrong group being selected
Remember: Shopify tries groups in order and uses the first one with available stock. If Group 1 is out of stock, it moves to Group 2 automatically.Verify stock levels at each location for the products in question.
Threshold not working as expected
Threshold not working as expected
Check your operator:
- Greater Than 10 triggers at 11+ items (not 10)
- Greater Than Or Equal 10 triggers at 10+ items
Related
Cart Constraints
Block locations based on cart properties (hard rules)
Customer Rules
Prioritize by who is buying
Inventory Rules
Prioritize by stock availability
Capacity Rules
Prioritize by location capacity