Shipping Scenario Provided by the Store Owner
The primary products are:
- Desks
- Mats
- Chairs
- Heaters
Each will have a delivery period for a single item and then add-ons for additional items as follows:
Mats
Quantity ordered / Delivery price:
1. £6.95
2. £9.95
3/4. £12.95
5/6/7. £15.95
8/9/10. £18.95
11+ FREEDesks
Quantity ordered / Delivery price:
1. £55
2/3. £95
4+ FREEChairs
Quantity ordered / Delivery price:
1. £55
2/3. £95
4+ FREEHeaters
Quantity ordered / Delivery price:
1. £19.95
2/3. £38.95
4/5/6. £49.95
7/8/9. £69.95
10+ FREE
This scenario defines four distinct product types (Mats, Desks, Chairs, and Heaters), each with its own quantity-based shipping cost table. The shipping cost for each product type is calculated independently based on how many units of that product type are in the order, and then summed together for a final shipping cost.
Key points and edge cases:
Below is the proposed order of rules. Each set of rules applies exclusively to one product category, checking how many items of that category are present. Exactly one rule from each category will match a specific quantity range, so you only pay the correct bracket for that product type. Because we do not stop processing after matching one bracket (i.e., we do not use a “stop” action in these rules), any other product category’s rules will also apply as needed.
Below is the JSON rules table configuration that implements this scenario. It satisfies the required schema by including an array of rules (each rule with conditions, cost_per_order, additional_costs, and special_action). Present this as a single configuration file:
{
"rules_table": {
"rules": [
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["mats"]
},
{
"condition_id": "item",
"operator": "is",
"min": "1",
"max": "1"
}
],
"cost_per_order": "6.95",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["mats"]
},
{
"condition_id": "item",
"operator": "is",
"min": "2",
"max": "2"
}
],
"cost_per_order": "9.95",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["mats"]
},
{
"condition_id": "item",
"operator": "is",
"min": "3",
"max": "4"
}
],
"cost_per_order": "12.95",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["mats"]
},
{
"condition_id": "item",
"operator": "is",
"min": "5",
"max": "7"
}
],
"cost_per_order": "15.95",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["mats"]
},
{
"condition_id": "item",
"operator": "is",
"min": "8",
"max": "10"
}
],
"cost_per_order": "18.95",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["mats"]
},
{
"condition_id": "item",
"operator": "is",
"min": "11",
"max": ""
}
],
"cost_per_order": "0",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["desks"]
},
{
"condition_id": "item",
"operator": "is",
"min": "1",
"max": "1"
}
],
"cost_per_order": "55",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["desks"]
},
{
"condition_id": "item",
"operator": "is",
"min": "2",
"max": "3"
}
],
"cost_per_order": "95",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["desks"]
},
{
"condition_id": "item",
"operator": "is",
"min": "4",
"max": ""
}
],
"cost_per_order": "0",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["chairs"]
},
{
"condition_id": "item",
"operator": "is",
"min": "1",
"max": "1"
}
],
"cost_per_order": "55",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["chairs"]
},
{
"condition_id": "item",
"operator": "is",
"min": "2",
"max": "3"
}
],
"cost_per_order": "95",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["chairs"]
},
{
"condition_id": "item",
"operator": "is",
"min": "4",
"max": ""
}
],
"cost_per_order": "0",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["heaters"]
},
{
"condition_id": "item",
"operator": "is",
"min": "1",
"max": "1"
}
],
"cost_per_order": "19.95",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["heaters"]
},
{
"condition_id": "item",
"operator": "is",
"min": "2",
"max": "3"
}
],
"cost_per_order": "38.95",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["heaters"]
},
{
"condition_id": "item",
"operator": "is",
"min": "4",
"max": "6"
}
],
"cost_per_order": "49.95",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["heaters"]
},
{
"condition_id": "item",
"operator": "is",
"min": "7",
"max": "9"
}
],
"cost_per_order": "69.95",
"additional_costs": [],
"special_action": "none"
},
{
"conditions": [
{
"condition_id": "product_category",
"operator": "any",
"product_category": ["heaters"]
},
{
"condition_id": "item",
"operator": "is",
"min": "10",
"max": ""
}
],
"cost_per_order": "0",
"additional_costs": [],
"special_action": "none"
}
]
}
}
To use this configuration: Copy the entire JSON code shown above and paste it into your Flexible Shipping PRO rules table using the “Paste” button.
Let’s revisit a few test scenarios to confirm the rules produce the correct costs:
All these outcomes reflect the shipping charges specified in the original description. Therefore, the rules table above is both valid per the schema and accurate to the store owner’s quantity-based shipping costs.