Common Scenarios
This guide provides real-world examples of rule configurations for common shipping scenarios, covering all supported condition types.
Scenario 1: Weight-Based Tiered Pricing (cart_weight)
Business Requirement: Charge different shipping rates based on cart weight tiers.
Configuration
[
{
"name": "Over 30kg €200",
"type": "modify_method_price",
"price": 200.00,
"priority": 0,
"conditions_match": "all",
"conditions": [
{"type": "cart_weight", "value": ["30"], "operator": ">"}
]
},
{
"name": "Over 20kg €100",
"type": "modify_method_price",
"price": 100.00,
"priority": 1,
"conditions_match": "all",
"conditions": [
{"type": "cart_weight", "value": ["20"], "operator": ">"}
]
},
{
"name": "Over 10kg €50",
"type": "modify_method_price",
"price": 50.00,
"priority": 2,
"conditions_match": "all",
"conditions": [
{"type": "cart_weight", "value": ["10"], "operator": ">"}
]
}
]
Expected Results
| Cart Weight | Shipping Cost |
|---|---|
| 5kg | Base rate |
| 12kg | €50 |
| 22kg | €100 |
| 35kg | €200 |
WHY THIS ORDER?
Priority 0 checks the highest threshold first (30kg). If that doesn't match, it falls through to 20kg, then 10kg. See Priority System for details.
Scenario 2: Free Shipping Over Threshold (cart_value)
Business Requirement: Offer free shipping for orders over €100.
Configuration
[
{
"name": "Free Shipping Over €100",
"type": "modify_method_price",
"price": 0.00,
"priority": 0,
"conditions_match": "all",
"conditions": [
{"type": "cart_value", "value": ["100"], "operator": ">="}
]
}
]
Expected Results
| Cart Subtotal | Shipping Cost |
|---|---|
| €50 | Base rate |
| €100 | €0 (Free) |
| €150 | €0 (Free) |
Scenario 3: Bulk Order Discount (cart_item_count)
Business Requirement: Orders with 10+ items get discounted shipping.
Configuration
[
{
"name": "Bulk Order Shipping",
"type": "modify_method_price",
"price": 5.00,
"priority": 0,
"conditions_match": "all",
"conditions": [
{"type": "cart_item_count", "value": ["10"], "operator": ">="}
]
}
]
Expected Results
| Item Count | Shipping Cost |
|---|---|
| 5 items | Base rate |
| 10 items | €5 |
| 25 items | €5 |
ITEM COUNT
This counts the total quantity across all line items. A cart with 3× Product A and 7× Product B has count = 10.
Scenario 4: Product Tag Handling (product_tag)
Business Requirement: Disable express shipping for hazardous materials.
Configuration
[
{
"name": "No Express for Hazmat",
"type": "disable_method",
"priority": 0,
"conditions_match": "any",
"conditions": [
{"type": "product_tag", "value": ["hazmat", "dangerous", "fragile"], "operator": "one_of_equal"}
]
}
]
Expected Results
| Cart Contents | Express Shipping Available? |
|---|---|
| Regular products only | ✅ Yes |
| One product with "hazmat" tag | ❌ No (disabled) |
| Mix of products (one is fragile) | ❌ No (disabled) |
OPERATOR LOGIC
one_of_equal matches if any product has any of the specified tags. Only one matching product is needed to trigger the rule.
Scenario 5: Collection-Based Rules (product_collection)
Business Requirement: Free shipping for clearance items, but not for express method.
Configuration
[
{
"name": "No Express for Clearance",
"type": "disable_method",
"priority": 0,
"conditions_match": "any",
"conditions": [
{"type": "product_collection", "value": ["Clearance", "Sale Items", "Outlet"], "operator": "one_of_equal"}
]
}
]
Expected Results
| Cart Contains | Express Shipping Available? |
|---|---|
| Regular products | ✅ Yes |
| Product from "Clearance" collection | ❌ No (disabled) |
| Mix (one clearance item) | ❌ No (disabled) |
COLLECTION DETECTION
Matching checks if any product in the cart belongs to any of the specified collections. Collection titles are case-insensitive.
Scenario 6: Country-Based Pricing (shipment_country)
Business Requirement: Different rates for UK, EU, and rest of world.
Configuration
[
{
"name": "UK Shipping",
"type": "modify_method_price",
"price": 10.00,
"priority": 0,
"conditions_match": "all",
"conditions": [
{"type": "shipment_country", "value": ["GB"], "operator": "one_of_equal"}
]
},
{
"name": "EU Shipping",
"type": "modify_method_price",
"price": 20.00,
"priority": 1,
"conditions_match": "any",
"conditions": [
{"type": "shipment_country", "value": ["DE", "FR", "IT", "ES", "NL", "BE"], "operator": "one_of_equal"}
]
},
{
"name": "Rest of World",
"type": "modify_method_price",
"price": 50.00,
"priority": 2,
"conditions_match": "all",
"conditions": [
{"type": "shipment_country", "value": ["GB", "DE", "FR", "IT", "ES", "NL", "BE"], "operator": "one_of_not_equal"}
]
}
]
Expected Results
| Destination | Shipping Cost |
|---|---|
| United Kingdom (GB) | €10 |
| Germany (DE) | €20 |
| France (FR) | €20 |
| United States (US) | €50 |
| Australia (AU) | €50 |
CONDITIONS_MATCH
EU rule uses conditions_match: "any" because we want to match any of the listed countries. Rest of World uses one_of_not_equal to match countries NOT in the list.
Scenario 7: Postcode-Based Surcharges (shipment_postcode)
Business Requirement: Add surcharges for remote UK postcodes.
Configuration
[
{
"name": "Scottish Highlands",
"type": "modify_method_price",
"price": 35.00,
"priority": 0,
"conditions_match": "any",
"conditions": [
{"type": "shipment_postcode", "value": ["AB*", "IV*", "KW*", "PA20*", "PA21*", "PH*"], "operator": "one_of_equal"}
]
},
{
"name": "Northern Ireland",
"type": "modify_method_price",
"price": 25.00,
"priority": 1,
"conditions_match": "any",
"conditions": [
{"type": "shipment_postcode", "value": ["BT*"], "operator": "one_of_equal"}
]
}
]
Expected Results
| Postcode | Shipping Cost | Matched Rule |
|---|---|---|
| AB10 1XG | €35 | Scottish Highlands |
| IV2 3AA | €35 | Scottish Highlands |
| BT1 1AA | €25 | Northern Ireland |
| E1 6AN (London) | Base rate | None |
PATTERN MATCHING
* is a wildcard matching any characters. AB* matches AB10, AB11, AB99, etc. Patterns are case-insensitive.
Scenario 8: Shipping Zone Pricing (shipping_zone)
Business Requirement: Apply different rates per Shopify-defined zone.
Configuration
[
{
"name": "Premium Zone Rate",
"type": "modify_method_price",
"price": 15.00,
"priority": 0,
"conditions_match": "all",
"conditions": [
{"type": "shipping_zone", "value": ["gid://shopify/DeliveryZone/123456"], "operator": "one_of_equal"}
]
},
{
"name": "Standard Zone Rate",
"type": "modify_method_price",
"price": 25.00,
"priority": 1,
"conditions_match": "all",
"conditions": [
{"type": "shipping_zone", "value": ["gid://shopify/DeliveryZone/789012"], "operator": "one_of_equal"}
]
}
]
Expected Results
| Destination Country | Shopify Zone | Shipping Cost |
|---|---|---|
| GB | Zone 123456 | €15 |
| DE | Zone 789012 | €25 |
| US | Zone 789012 | €25 |
FINDING ZONE IDS
Zone IDs follow format gid://shopify/DeliveryZone/{ID}. Find them in Shopify Admin → Settings → Shipping.
Scenario 9: Origin-Based Pricing (sender_location)
Business Requirement: Different rates depending on which warehouse ships the order.
Configuration
[
{
"name": "US Warehouse Surcharge",
"type": "modify_method_price",
"price": 75.00,
"priority": 0,
"conditions_match": "all",
"conditions": [
{"type": "sender_location", "value": ["US", "United States", "New York"], "operator": "one_of_equal"}
]
},
{
"name": "EU Warehouse Rate",
"type": "modify_method_price",
"price": 25.00,
"priority": 1,
"conditions_match": "all",
"conditions": [
{"type": "sender_location", "value": ["SE", "Stockholm", "Malmö"], "operator": "one_of_equal"}
]
}
]
Expected Results
| Origin Location | Shipping Cost |
|---|---|
| New York, US | €75 |
| Stockholm, SE | €25 |
| Malmö, SE | €25 |
MATCHING LOGIC
Condition matches if location name contains the origin city or country code. "SE warehouse Stockholm" matches if origin city is "Stockholm" OR country is "SE".
Scenario 10: B2B Pricing (customer_type)
Business Requirement: Business customers get special rates.
Configuration
[
{
"name": "B2B Flat Rate",
"type": "modify_method_price",
"price": 15.00,
"priority": 0,
"conditions_match": "all",
"conditions": [
{"type": "customer_type", "value": ["company"], "operator": "="}
]
}
]
Expected Results
| Customer Type | Shipping Cost |
|---|---|
| Individual (no company name) | Base rate |
| Company (has company name) | €15 |
B2B DETECTION
Customer is classified as "company" if the checkout destination has a company_name field populated. Otherwise, they're "individual".
Scenario 11: Combine Weight and Value (cart_weight + cart_value)
Business Requirement: Heavy AND expensive orders get special handling fee.
Configuration
[
{
"name": "Premium Heavy Order Fee",
"type": "modify_method_price",
"price": 150.00,
"priority": 0,
"conditions_match": "all",
"conditions": [
{"type": "cart_weight", "value": ["20"], "operator": ">"},
{"type": "cart_value", "value": ["500"], "operator": ">="}
]
},
{
"name": "Heavy Order Fee",
"type": "modify_method_price",
"price": 100.00,
"priority": 1,
"conditions_match": "all",
"conditions": [
{"type": "cart_weight", "value": ["20"], "operator": ">"}
]
}
]
Expected Results
| Weight | Subtotal | Shipping Cost | Applied Rule |
|---|---|---|---|
| 25kg | €600 | €150 | Premium Heavy (both conditions match) |
| 25kg | €400 | €100 | Heavy Order (only weight matches) |
| 15kg | €600 | Base rate | Neither rule matches |
WHY THIS ORDER?
"Premium Heavy Order" (Priority 0) has MORE specific conditions (requires BOTH weight AND subtotal). "Heavy Order" (Priority 1) is less specific (only requires weight).
Scenario 12: Exclude Free Shipping for Heavy Items
Business Requirement: Free shipping over €100, but NOT if order is heavy (>20kg).
Configuration
[
{
"name": "Heavy Order Standard Rate",
"type": "modify_method_price",
"price": 50.00,
"priority": 0,
"conditions_match": "all",
"conditions": [
{"type": "cart_weight", "value": ["20"], "operator": ">"}
]
},
{
"name": "Free Shipping Over €100",
"type": "modify_method_price",
"price": 0.00,
"priority": 1,
"conditions_match": "all",
"conditions": [
{"type": "cart_value", "value": ["100"], "operator": ">="}
]
}
]
Expected Results
| Weight | Subtotal | Shipping Cost | Why? |
|---|---|---|---|
| 25kg | €150 | €50 | Heavy rule (Priority 0) matches first, stops execution |
| 15kg | €150 | €0 | Heavy rule fails, free shipping rule (Priority 1) matches |
| 15kg | €50 | Base rate | Neither rule matches |
PRIORITY OVERRIDE
The "Heavy Order" rule has Priority 0, so it checks first and prevents free shipping from applying to heavy orders, even if the subtotal qualifies.
Best Practices Summary
- Most Specific First: Assign Priority 0 to your most restrictive rules
- Test Boundary Cases: Always test values at and around your thresholds
- Document Your Logic: Use clear, descriptive rule names
- Single Responsibility: Each rule should do one thing well
- Avoid Overlapping Conditions: Design rules so their intent is clear
- Use Correct Field Names: Always use the exact condition type names from the Condition Types reference
Condition Type Coverage
This guide includes examples for all 10 supported condition types:
| Condition Type | Scenario(s) |
|---|---|
cart_weight | 1, 11, 12 |
cart_value | 2, 11, 12 |
cart_item_count | 3 |
product_tag | 4 |
product_collection | 5 |
shipment_country | 6 |
shipment_postcode | 7 |
shipping_zone | 8 |
sender_location | 9 |
customer_type | 10 |
Next Steps
- Condition Types - Full reference for all conditions
- Priority System - Deep dive into how priority works
- Troubleshooting - Fix common configuration issues
