Table of Contents
“The first 31kg is £25.42 then the additional cost of £0.46 per kilo up to a max of 350kg.”
Analysis of the Shipping Scenario
In this scenario:
- If a package weighs up to 31 kg, the shipping cost is £25.42.
-
For weights above 31 kg and up to 350 kg, the shipping cost applies a fixed portion plus £0.46 per kilogram.
We must subtract the cost that covers the first 31 kg. Hence:25.42 − (31 × 0.46) = 25.42 − 14.26 = 11.16
- Beyond 350 kg, shipping is unavailable.
Edge Cases
- Weight = 0 to 31 kg: Cost is £25.42.
- Weight = 31: Cost remains £25.42.
- Weight = 31.001 kg: The cost becomes 11.16 + (31.001 × 0.46) ≈ £25.42.
- Weight = 350 kg: The cost is 11.16 + (350 × 0.46) = £172.16.
- Weight > 350 kg: Shipping is unavailable.
Order of the Rules
- Rule 1: Weight 0–31 kg ⇒ Cost is £25.42.
- Rule 2: Weight 31.001–350 kg ⇒ Cost is £11.16 plus £0.46 per kilogram of total weight.
- If weight > 350 kg, no rules match ⇒ no shipping method displayed.
JSON Configuration
Use the configuration below in the Flexible Shipping PRO plugin. Click “Paste” and insert:
{ "rules_table": { "rules": [ { "conditions": [ { "condition_id": "weight", "operator": "is", "min": "0", "max": "31" } ], "cost_per_order": "25.42", "additional_costs": [], "special_action": "none" }, { "conditions": [ { "condition_id": "weight", "operator": "is", "min": "31.001", "max": "350" } ], "cost_per_order": "11.16", "additional_costs": [ { "additional_cost": "0.46", "per_value": "1", "based_on": "weight" } ], "special_action": "none" } ] } }
To use this configuration, copy and paste it into the rules table in Flexible Shipping PRO.
Verification with Edge Cases
- Weight = 0–31 kg: Rule 1 applies, total cost = £25.42.
- Weight = 31 kg: Still Rule 1, total cost = £25.42.
-
Weight = 31.001 kg: Rule 2 applies:
cost = 11.16 + (31.001 × 0.46) ≈ £25.42. -
Weight = 350 kg: Rule 2 applies:
cost = 11.16 + (350 × 0.46) = £172.16. - Weight > 350 kg: No rule matched ⇒ shipping unavailable.