Guides / WooCommerce
Hide a shipping method for certain products or postcodes in WooCommerce
Some products cannot go by courier. Some postcodes are not worth serving with free shipping. WooCommerce gives you a few tools for this, and then runs out. Here is what each one does.
1. Shipping zones: limit a method to places
Under WooCommerce > Settings > Shipping, each zone covers countries, states or postcodes. Postcodes can use wildcards (SW1*) and ranges (90210...99000). Add a method only to the zone where it should appear, and customers elsewhere will not see it. This is the right tool for "this method only for these postcodes".
2. Shipping classes: price by product type
You can give a product a shipping class, such as "Bulky", and set a different cost per class on a method. This changes the price. It does not remove the method, so a customer can still choose a method that does not suit a heavy item.
3. Free shipping that needs a minimum
The Free shipping method can require a minimum order amount or a coupon. When it applies, WooCommerce still shows your paid methods next to it, unless you hide them.
What WooCommerce cannot do alone
- Hide a method when the cart contains a certain product or category.
- Hide paid options when free shipping is available.
- Hide a method for one customer role, or for a first-time customer.
For these you need a code snippet that filters the shipping rates, or a plugin. A snippet works, but it lives in a theme file or snippet plugin, and a small mistake can leave customers with no way to ship.
Do it with Tadrik Checkout Rules
Tadrik Checkout Rules adds a page under WooCommerce > Checkout Rules where each rule reads as a sentence:
Rules can hide shipping methods, or offer only some, using conditions such as:
- products, categories and shipping classes in the cart;
- postcode or ZIP, with wildcards and ranges (Pro);
- cart total, number of items and cart weight;
- customer role (guests included), country or state, and coupons.
Hiding by products, categories, shipping classes, cart total, role, country and coupon is in the free plugin. The postcode condition is a Pro feature ($49/year, 14-day trial without a card).
A typical example is hiding the paid options whenever free shipping is on offer, or hiding free shipping when the cart holds a bulky item.
Test before you switch it on
The Test a cart tab lets you pick a customer, an address and some products. It lists every payment and shipping method, which rule hid each one, and why. Rules also have an on/off switch.
It is built not to lock customers out
If your rules would leave a customer with no way to ship or pay, the plugin shows every method instead and puts a warning on its page. If anything fails inside the plugin, checkout works as if it were not installed. A customer cannot pick a hidden method by editing the page, because WooCommerce only accepts the methods on offer. It works with the block checkout and the classic one.
Tadrik Checkout Rules
Write each rule as a sentence, test it on a sample cart, then switch it on. Works with the block checkout and the classic one.
See Tadrik Checkout Rules