Disable TableRates shipping method depend of weight

First a big thanks about TableRates : I really appreciate to see the flexibility of Commerce :wink:

Now my small problem :slight_smile:
I want to disable a TableRates shipping method if the order weight is superior to a specific value.
But it’s look not possible with the current version of TableRates, unless I miss something…

That’s correct, unfortunately. TableRates or shipping methods in general cannot be enabled/disabled based on weight.

And can’t we do a test inside the twig template to check if the order weight is > 30kg ?

That might work, but doesn’t technically prevent the shipping method from being available. It may still be set on an order or be automatically selected if it’s the first available shipping method.

Total weight is on the shipment, so that should be in {{ shipment[0].total_weight }} and the unit in {{ shipment[0].total_weight_unit }} - the unit depends on the unit used for the products added to the cart.

I will try on this way :slight_smile:

I have found a workaround : my customer has only one type of identical products, with a unique weight.
So I simply used the field “Max. Order Item Quantity” to the correct item/weight.
But in another context, it could be useful to have a field “Max. Order Weight” for some shipment case…

1 Like