Applying free shipping on orders can be great incentive for (potential) customers to order on your website. In some cases it is not possible to ship all products free and you only want to ship a specific product or group of products to ship for free. In this post I will go through setting this up. Note that there are different use cases, plugins etc that can be used by people. I will try to go over the most common ones in this blog post.

Using WooCommerce Advanced Free Shipping

WooCommerce Advanced Free Shipping (WAFS) is a plugin that I created that allows you to setup free shipping for the entire order. There is no way for that plugin to allow free shipping for one specific product (as it doesn’t know how the original shipping cost has been setup). This question arises from time to time, so I wanted to make this clear.

Apply free shipping when using a shipping carrier plugin

When you’re using a shipping carrier plugin like UPS, FedEx USPS etc that is getting live quotes from their respective API you can accomplish this in various ways.

Setting weight/dimensions

One of those ways is by setting either (or both) the weight and dimensions to 0. Depending on the shipping carrier, they may use the weight or size to calculate the shipping cost based on that. When a product has 0 weight it shouldn’t take that in account for shipping.
I’ve never used shipping carrier plugins like this, but I’ve had multiple users confirm this to me.

This may or may not work for you was you will have inaccurate data for some products in case you were using the weight/dimensions field.

Splitting the order

A user of the WAFS plugin came with this solution, and it works really well in many cases. I’ve written about splitting shipping packages before. When you split an order into multiple packages, you can use the ‘WooCommerce Advanced Shipping’ plugin to setup free shipping for the package that contains the products you want to ship for free.

Another method is to have a regular (WC Core) free shipping rate, and hide it by excluding it from the paid shipping packages (you’d have to keep up with this if you create more packages in the future).

Apply free shipping when setting up your own shipping cost

This is a hard one as it is really dependent on how you calculate your shipping cost.

Shipping class

If you’re using shipping classes to setup the shipping cost you can easily assign a ‘free shipping’ class to those products who you want to have free shipping, and assign shipping costs to the other classes.

Weight based shipping cost

If you’ve setup your shippnig cost to be weight based it can be difficult, but there are still some options available.

1) Splitting the order into multiple packages as described above (and below again)
2) Setting the weight in the product to 0. This will make sure that you weight shipping rules do not take this product in account.
3) Changing the matching function. This one is with my own plugins in mind, as they allow the matching function to be changed, letting you create your own matching functionality, and thus exclude the weight of the free shipping products from the total weight. This requires custom coding and does require programming knowledge.

Flat rate

If you have a flat rate for shipping than this shouldn’t change much.

Splitting the order

The same technique can be used here as described above. By splitting the order and setting up free shipping for the package that contains the free shipping products.

I need your help

Did you read the post and didn’t find a solution useful for your case? Please let me know in the comments below. If its a good use case I will add it to the post. That way I can extend the post to include more and better solutions.

Jeroen Sormani

I'm a professional WordPress plugin developer on a mission to create the best plugins for my clients. I'm specialised in developing general WordPress, WooCommerce and Easy Digital Downloads plugins.

Interested in talking about a WordPress project? Get in touch!

Follow me on Twitter

66 thoughts on “Apply Free Shipping for Specific Products in WooCommerce

Uriel November 1, 2018 at 7:13 pm

Hi! Thanks for your script, I’m using Woodmart theme and I’d like to show message in the mini-cart widget, I tried to set it in this line:

if ( ! is_cart() && ! is_checkout() && ! is_mini-cart() )

but it gets error, can you help me?

Jeroen Sormani November 5, 2018 at 12:11 pm

Hi Uriel,

Thats a peace of invalid code – if you’re not experienced with coding I’d recommend having your developer assist you with this. Customizing code without experience can be real time consuming and break your site.

Cheers,
Jeroen

Skip Walker November 3, 2018 at 6:41 am

Jeroen,

I am new to WordPress and Woo, so forgive the lack of knowledge. We are moving our site to woo soon. We ship books in the US only.

We charge a flat rate for shipping up to a set number of books – regardless of type. All the same, a mixed selection, etc. As long as the total is under the threshold. Over the threshold, shipping is free.

Can your plugin handle that logic? I’d assume yes, but wanted to check to make sure.

Jeroen Sormani November 5, 2018 at 12:10 pm

Yes, this is possible 🙂

Brenda November 5, 2018 at 6:09 am

THANK YOU for this plugin! Super helpful.

Jason November 17, 2018 at 7:48 pm

Hello,

Is there a way to set the free shipping option as the default setting while still showing the other shipping options? Sometimes people qualify for free shipping, but want to upgrade to Express shipping. Other times people forget to click on the free shipping.

http://prntscr.com/ljljxw

Thanks,

Jason

Marc C. November 24, 2018 at 6:53 am

Hi Jeroen,
Thank you for your plugins and guidance. I have a WordPress site that is using the Woocommerce storefront and currently all my products are set to ship via USPS Priority Mail based on their package dimensions and package weight. I need to add a new product that needs to ship for free and in a separate package. So far, I have not been able to do this and have only been able to add a free shipping option that allows the customer to select free shipping for their entire order and not just the single product which does qualify for free shipping.

Do you have the plugins that would allow a customer to purchase some of my regular products and pay the shipping on those while also order the free shipping product on the same order and allow that to ship for free, in an automated way?

Thank you, sir.

Jeroen Sormani November 24, 2018 at 10:57 am

Hi Marc,

Thats exactly one of the most common use cases of the https://woocommerce.com/products/woocommerce-advanced-shipping-packages/ plugin 🙂

Cheers,
Jeroen

Nadia November 26, 2018 at 3:24 am

Hi, I have set up a package- how do I now apply this so that it gets considered in an order. I am using advanced shipping etc. Your posts explain how to set it up- but then how does it get applied in the cart?

Michele December 5, 2018 at 11:05 am

Hello! I have the following situations:

1) Minimum free delivery cost is 300 euro;
2) I have products which for 2 pieces from the same product I offer a discount and for 3 pieces for the same product I offer a bigger discount, but if the amount of these pieces do not match with minimum 300 euro order, I charge delivery taxes;
3) The exception: I have products for whice one I offer for 2 pieces from the same product a discount and free delivery as well, even if total amount in basket it is under 300 euro (minimum amount for free delivery).

How could I fix this? So, I do need to apply discount for 2 or 3 pieces from the same product and in the same time to apply delivery rules for under 300 euro total amount and for those which I offer only discount (not free delivery) to be applied the global rule for free delivery when the customer match the minimum amount of 300 euro!

Ross Turner March 4, 2019 at 6:47 pm

Hi there,

Firstly, great plugin thank you!

I use flat rate shipping based on postcode. What I want to achieve is that is someone spends over 24.00 on category A they receive free shipping. I have set this up and it works.

However if in the order the customer has 3 products from category A, totalling £30 and 1 product from Category B, totalling £5 pounds – free shipping is not added.

I currently have my conditions set to subtotal over or equal to 24.00 and category equals to A.

Is there a fix? Your help is greatly appreciated.

Kind regards,
Ross Turner

Jeroen Sormani March 5, 2019 at 9:50 am

Hi Ross,

For support questions about my Advanced Shipping plugin, please reach out through http://jeroensormani.com/woocommerce-advanced-shipping/support

Cheers,
Jeroen

Stephane April 19, 2019 at 11:33 am

Hi,

I’m trying to do this with your plugin:

For shipping class “A” I want free shipping when subtotal is greater than 60.
For shipping class “B” shipping is free.
But, when customers want the two kinds of products, shipping class “B” make the shipping free because the subtotal is greater than 60, but the subtotal for shipping class “A” is under 60. So, shipping should not be free.

Can you help?
Thanks.

Jeroen Sormani April 20, 2019 at 9:40 am

Hi Stephane,

The ‘Subtotal’ condition is always based on the cart amount, not of individual packages as explained here. I’d recommend creating a custom condition that’ll fit your needs for this for the Advanced Shipping plugin.

Cheers,
Jeroen

vahid May 1, 2019 at 4:54 am

hi,
I have free shipping products and paid shipping products in my website. paid shipping products are configured as per weight based shipping as am selling some heavy items. So i need the following scenarios to be configured.
1. Free shipping method should be applied when only free shipping products available in cart,
2. Weight based shipping method should be applied when a customer add any other products along with free shipping products.

Hope my idea is clear to you. Any help would be apreicated

Jeroen Sormani May 1, 2019 at 9:46 am

Hi Vahid,

You can set this up with my Advanced Shipping plugin 🙂

Mikkel November 12, 2020 at 6:11 pm

Hi Jeroen.

I am looking for a solution that can fulfil a need we have to have one shipping class overrule another.

At the moment:
– We have two products which ship for free. They have the shipping class “Free Partner Shipping”. All other products have no shipping class and there is a flat fee for all these products.
– If a customer includes a product within the shipping class “Free Partner Shipping” and also a product with no shipping class, the flat fee is applied.

What we want to achieve:
– If a customer includes a product within the shipping class “Free Partner Shipping” and also a product with no shipping class, the “Free Partner Shipping” will overrule the flat fee from no shipping class and the customer will have free shipping on the entire order.

Hope it makes sense and that you can help 🙂

Jeroen Sormani November 12, 2020 at 7:25 pm

hi Mikkel,

You can create a conditional free shipping rate like this with the Advanced Free Shipping plugin.

Cheers,
Jeroen

Mikkel November 13, 2020 at 7:26 pm

Hi again Jeroen.

It has no updates since 2017. How can we make sure it’s not going to disturb other plugins or similar?

Do you offer either full support or a money back guarantee?

Sean December 9, 2020 at 10:06 pm

I am unsure if free shipping is automatically applied if I use this plugin. It might be good to also give notice that they have qualified with a popup, but mainly I just want it to be applied to the total of the cart and be applied automatically. Is this the case with this plugin?

thanks

Jeroen Sormani February 15, 2021 at 10:33 am

No popup or anything, but it will be automatically available at the checkout when the conditions have matched.

Natalie February 15, 2021 at 9:26 am

Hi good day, I have different free shipping rules for different shipping zones.
May I know how to I add in a series of zipcodes into AFS? currently zipcode can only be added one by one.

Thank you

Jeroen Sormani February 15, 2021 at 10:32 am

Hi Natalie,

Try using a comma separated list of zipcodes.

Cheers,
Jeroen

Deana Rock June 8, 2021 at 8:01 pm

Hi Jeroen,

I am attempting to create a situation where the following happens:

Order Item #1 (Usually has shipping applied)
Order Item #2 (Usually has free shipping)

When a customer orders Item #2 WITH Item #1, they get free shipping. How do I accomplish this?

Jeroen Sormani June 9, 2021 at 10:33 am

Hi Deana,

Using the ‘Contains product’ condition you can check if #2 is in the cart and apply the free shipping rate accordingly.

Cheers,
Jeroen

Marc Weiser November 18, 2021 at 6:14 pm

Hello, I’ve used your code to create packages for the “Free Shipping” shipping class.

You say that “When you split an order into multiple packages, you can use the ‘WooCommerce Advanced Shipping’ plugin to setup free shipping for the package that contains the products you want to ship for free.”

In WooCommerce Advanced Shipping I’ve created a conditional rule to allow free shipping when the cart contains shipping class equal to Free Shipping but this applies free shipping to both packages. Also applies free shipping to both packages when I’ve set contains product equal to the product.

Am I doing something wrong? I don’t see the conditional rules for Packages

Jeroen Sormani November 21, 2021 at 12:07 pm

Hi Marc,

Product related conditions are based on the package contents in the Advanced Shipping plugin. If you need help with this I’d recommend getting in touch through the support channel here; https://jeroensormani.com/woocommerce-advanced-shipping/support/

Cheers,
Jeroen

Peter Højlund Palluth December 16, 2021 at 3:10 pm

If you have other products that has the weight of “0” – or you are just afraid that you will have one day.

You can also set the weight to “-1”, then it wouldn’t accidentally hit something that it shouldn’t.

Thank you for a great plugin!
Saved hours of work for me. Woocommerce shipping coding is so time consuming!

Best

John Capone January 10, 2022 at 6:58 pm

Hi Jeroen,

See that there is no pop-up alert or the like when free shipping is an option. But is there a way you know to get this to default to free shipping when the option is available? Ours seems to be defaulting to USPS priority (using the Woo USPS plugin).

Any ideas?

Thank you again for the plugin. It works great and we are just trying to smooth this out as have some customers not notiving.

Jeroen Sormani January 12, 2022 at 5:28 am

Hi John,

WooCommerce automatically uses the first option in the list as the default selected option. If you combine this with other plugins you can use the latest version of my Advanced Shipping plugin to setup shipping rates in the WC Zones and make sure its sorted at the top of those other rates.
Alternatively the re-ordering of rates can also be done with a separate customization (I don’t have something readily available for this).

Cheers,
Jeroen

Leave a Reply