The free edition: one band decides
When WooCommerce asks Table rates (Gatemi) for a rate:
- It reads the method's Rate table and skips any line it cannot read.
- It measures the package: the contents cost (items needing shipping, after coupons, before tax) or the total weight.
- It walks the bands from the top and takes the first whose minimum and maximum (both inclusive) contain the measure.
- It offers one rate at that band's cost, taxed or not as Tax status says.
- If no band matches, it offers no rate. It never invents a price.
Example
0 - 1.99 : 3.50
2 - 9.99 : 6.95
10 - * : 12.00
With Measure on Cart weight (kg), a 0.8 kg cart pays 3.50, a 4 kg cart 6.95 and a 25 kg cart 12.00.
The full edition: a table of rules
Shipping rules reads a rate table too, but each row has conditions and a cost made of several parts. Two rules govern the design.
One condition engine, declared once
The rule builder, the stored rules and the matching all come from one list of condition types. Rate rows and restrictions use the same engine, so "weight is at least 20" means exactly the same thing in a rate table as in a rule that hides the courier. A condition type nothing on the site understands never matches.
The order of operations
Every number you can type has one place in this order:
- Split into units. The whole delivery (per order), each single item, each cart line, or each shipping-class group.
- Match rows against each unit, in table order. Inactive rows are skipped.
- Row cost = Flat + Per item × items + Per weight unit × weight + Percent of goods × what the items cost after coupons. Then the row's own Never less than / Never more than.
- Within a unit, matching rows add up until one has Stop here ticked.
- Finish the unit: add the Handling fee (an amount, or a percentage of the unit's goods), then apply the method's Minimum cost and Maximum cost.
- Finish the rate: add the units up (a per-item unit is multiplied by the line's quantity), add the Handling fee per order, cap it at the Maximum for the whole order, and never go below zero.
Per order: each matching row is an option
In per-order mode, step 4 works differently on purpose: every matching row becomes its own selectable option, named after the row. That is how one table offers Standard and Express side by side.
| Row | Applies when | Flat | Stop here |
|---|---|---|---|
| Standard | (no conditions) | 4.95 | off |
| Express | Country is one of United Kingdom | 9.95 | off |
A UK shopper sees Standard 4.95 and Express 9.95. Everyone else sees Standard 4.95.
Stop here is on for a new row, and in this mode it means "this row is the answer": a matching row with Stop here ticked is offered on its own — any options collected from rows above it are dropped — and no later row is read. So untick Stop here on every row you want offered side by side, and leave it ticked on a row that should replace them, such as a single "Free delivery" row above everything else.
Per item, line or class: one rate added up
In the other modes the units are added into one rate, named after the method. For example, per shipping class:
| Row | Applies when | Flat | Per item |
|---|---|---|---|
| Bulky | Shipping class contains any of Bulky | 15.00 | 0 |
| Everything else | (no conditions) | 3.00 | 1.00 |
A cart with one sofa (Bulky) and three cushions (no class) has two units: the sofa's 15.00, and 3.00 + 3 × 1.00 = 6.00 for the cushions. The rate is 21.00.
Where it can, the plugin tells WooCommerce how much of the rate belongs to each cart item, so each item's share is taxed at that item's own rate. Once the per-order handling fee or the order maximum has moved the total, it hands over the single total instead.
A unit that matches no row means no rate at all from this method — never a rate that quietly ships part of the cart free. WooCommerce then shows whatever else the zone offers, and the When no rule matches sentence. If some goods really should ship free, end the table with a row that has no conditions and a cost of 0.
Cannot ship
A row ticked We cannot ship this at all stops the calculation when it matches: the method offers no rate, and the shopper reads What to tell the shopper instead of WooCommerce's "There are no shipping options available". This works on the classic cart and checkout and, through the Store API's error channel, on the Cart and Checkout blocks.
When no row matches at all, the method offers nothing and shows When no rule matches — but only if the shopper ends up with no shipping option from any method in the zone.
Restrictions — Full edition
Rules on WooCommerce → Settings → Shipping → Rules take options away:
- Shipping restrictions filter the rates of every method — this plugin's and other plugins' — through
woocommerce_package_ratesat priority 100, after everybody else. - Payment restrictions filter the payment methods through
woocommerce_available_payment_gatewaysat priority 100. They never run in wp-admin, so you can still take a payment by hand.
Each rule is judged on its own; every rule that matches applies.
- hide removes the named methods.
- allow only removes everything except them — unless that would leave nothing, in which case the rule is treated as not having matched. A typo in a method id therefore cannot take your checkout down.
Targets are matched the way merchants think about them: flat_rate:3 is one instance, flat_rate covers every flat-rate instance in every zone, and fedex* covers a carrier plugin's whole family of rate ids.
If a shipping restriction leaves nothing, the shopper reads your sentence; if payment restrictions leave nothing, the sentences of the matching payment rules replace WooCommerce's "no available payment methods" message.
Keeping WooCommerce's rate cache honest
WooCommerce caches each package's rates against a fingerprint of the package and skips the calculation while the fingerprint holds. A restriction that depends on something outside the package — the chosen payment method — would then appear broken. So when any active restriction uses a Payment method condition, the plugin puts the chosen payment method into the package, changing the fingerprint whenever the shopper picks another one.
Gatemi Conditional Shipping and the shared table
Restrictions live in {prefix}gmship_restrictions. The free Gatemi Conditional Shipping plugin writes up to five one-condition rules into the same table in the same shape, so a shop that started there finds its rules already on the Rules screen. While this plugin is active, Gatemi Conditional Shipping stands down.
