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

WordCamp Düsseldorf Orgateam

Best WordCamp Düsseldorf Ever

In 2019 we held our first and therefore guaranteed best WordCamp in Düsseldorf. It was a complete success and lots of fun for all participants.

Groupmail GDPR/DSGVO

GDPR and Generic E-Mail Accounts

How do you deal with topic-related e-mail accounts such as info@website.de in times of the GDPR? How can you ensure that data protection is not violated for incoming e-mail addresses.