Flexible Shipping (table rate)
Flexible Shipping is a WooCommerce shipping method that calculates the cost from a list of rules: by cart subtotal, cart weight, number of items and destination country. It is available as soon as Polski PRO is active; there is no module switch for it.
Adding the method
Section titled "Adding the method"Go to WooCommerce > Settings > Shipping, open a shipping zone, click Add shipping method and choose Flexible Shipping. Every instance has its own settings, so each zone can have its own rules. The zone decides where the method is offered; a rule can narrow that down to some countries.
Settings
Section titled "Settings"| Field | Key | Default | What it does |
|---|---|---|---|
| Method title | title |
Flexible Shipping | Name at checkout when the matching rule has no label |
| Tax status | tax_status |
Taxable | Saved, but the calculation does not read it yet: the cost is treated as taxable whatever you pick |
| Free shipping above | free_shipping_threshold |
0 (off) | When the cart subtotal reaches this amount, a free rate labelled "Method title (Free)" replaces all rules |
| Default cost | default_cost |
0 | Cost when there are no rules or none matches |
| Shipping rules | rules |
[] |
The rules as a JSON array, see below |
How the cost is chosen
Section titled "How the cost is chosen"- If Free shipping above is set and the cart subtotal reaches it, the rate is free. Countries are not checked at this step.
- Otherwise the rules are checked from the top. The first rule whose conditions all match sets the cost and the label.
- If no rule matches, the method charges the default cost under its title. The method always offers a rate, so a rule cannot hide it.
The values come from the cart:
- Cart subtotal: the subtotal WooCommerce displays in the cart (with or without tax, following your "Display prices during cart and checkout" setting), before coupons and without shipping.
- Weight: the total weight of the cart in the shop's weight unit (WooCommerce > Settings > Products). It is not converted, so if the shop uses grams, every weight value in the rules is in grams.
- Item count: the total quantity in the cart; three of one product count as 3.
- Country: the two-letter code of the shipping destination.
Rule fields
Section titled "Rule fields"| Key | Meaning |
|---|---|
label |
Rate name at checkout (optional) |
min_total, max_total |
Cart subtotal range. A missing or 0 maximum means no upper limit |
min_weight, max_weight |
Weight range, same rule for the maximum |
min_items, max_items |
Item count range, same rule for the maximum |
countries |
Country codes separated by commas, for example PL,DE,CZ. Empty means any country in the zone |
cost_type |
fixed (default), per_item (cost x item count), per_kg (cost x weight in the shop unit) or percent (percent of the cart subtotal) |
cost |
The amount, or the percentage for percent |
extra_kg_above, extra_kg_cost |
Surcharge: for every started unit of weight above extra_kg_above, add extra_kg_cost. 12.3 kg with a threshold of 10 adds 3 units |
Both ends of a range are included. A rule's cost never goes below 0.
Example
Section titled "Example"[ { "label": "Courier, Poland, up to 5 kg", "countries": "PL", "max_weight": 5, "cost_type": "fixed", "cost": 14.99 }, { "label": "Courier, Poland, heavy parcel", "countries": "PL", "min_weight": 5, "max_weight": 30, "cost_type": "fixed", "cost": 19.99, "extra_kg_above": 10, "extra_kg_cost": 2 }, { "label": "Courier, EU", "countries": "DE,CZ,SK,LT", "cost_type": "percent", "cost": 8 }]A 5 kg cart to Poland matches the first rule, because both ends of a range count. Put the narrower rule first when ranges touch.
What it does not do
Section titled "What it does not do"The rules are typed as JSON into the Shipping rules field; there is no visual rule editor. A rule cannot test the state or region (it is ignored), the postcode, product categories, shipping classes, the payment method or the customer's role.
How to plan weight and price bands is covered in the guide WooCommerce table rate shipping.