WooCommerce Free Shipping Excluded

WooCommerce Shipping
Image | CC0 pixabay

How to Exclude Shipping Classes from Free Shipping in WooCommerce

Let’s say we have a webshop selling accessories that can be shipped in ordinary parcels. You want to ship those for free when the order exceeds 100€. This is classic free shipping per minimum order value.

Now we decide to sell furniture as well with said webshop. Furniture has to be shipped differently ~ per trucking company ~ and should be excluded from free shipping. Here is what we do.


Keep reading for an explanation on how to go on about it.

Keep reading

The button will take you to a step by step guide through the process.


Take a look at what this is all about and see the feature in action.

Go there

The button will take you to a project were we implemented this feature.
Baby Kochs


Get the files from GitHub immediately and for free.

From GitHub

The button will take you to GitHub were the files you need are available.

As bulk shipping is calculated depending on size or weight, whichever turns out to cost more, it would be wise to not get into the complicated details and just create shipping classes for bulky goods roughly representing the costs. When shipping that giant wardrobe we want a shipping class with a slug ‘bulk-giant-wardrobes’ to then put costs to it depending on shipping zones. Here is what we need to add to our functions.php then.

WooCommerce is providing a hook (woocommerce_shipping_free_shipping_is_available) ~ an attachment point for our own logic ~ in the process of figuring out if free shipping should be available to the shopping cart or not.

We run $is_available through our own function after WooCommerce has decided if it should be true or false. We then cycle through all items in the shopping cart looking for a specific shipping class. When a shipping class slug starting with ‘bulk’ is found, we exit our function returning false, and the giant wardrobe is not available for free shipping anymore.


Share on facebook
Share on twitter
Share on linkedin

Related Posts

WooCommerce SQL

Howto Manipulate WooCommerce Metadata via SQL

With Germanized on board, WooCommerce has several ways to save article numbers. Has the intern spent two days entering the EAN in the wrong field for the 3000 articles in the WooCommerce online shop? Then an SQL superhero has to save the day who can copy content from one field to another in no time.

eCommerce Sales

5 eCommerce Lockdown Tips

eCommerce is booming because since Corona everyone understands the importance of online stores and digitization. We have been supporting online stores since the beginning of the millennium, when you still had to program them yourself, and we would like to tell you here how your eCommerce tools can make good sales and keep you afloat in a crisis.