Add Multiple Shipping Methods On WooCommerce Cart Pages

by Owais Alam  March 28, 2017

In this article, I will explain how to use different WooCommerce shipping methods on products in the same cart. Let’s say you have two products, one that must be shipped for free, and the second one with a flat shipping cost.

free shipping per product basis

Create WooCommerce Shipping Class

The first step is the creation of the required shipping classes. For this, follow these steps:

Go to WooCommerce Admin >> Settings >> Shipping >> Shipping Classes

Click the Add Shipping Class. You will get the following screen:

I have added two shipping classes, Free and Alpha. These classes are visible in the following screen:

Addition of Free Shipping for Specific Product(s) in the Cart

The next step assigns the shipping class to a product

Setting for the First Product

Settings for the Second Product

Now that you have assigned proper classes to products, you need to define flat rates for the classes. For this, go to WooCommerce Admin >> Settings >> Shipping >>Shipping Classes

Click the Add shipping method and you can get the following screen:

Net, it is time to define flat rates for the classes.

Remember that, for frees shipping class,  you must set the cost equal to Zero.

Next, all shipping packages should be separated (based on the shipping method – free or paid). This separation will be done using the custom code. For this, add the following code snippet in the functions.php file (located in the theme folder):

Once the code is executed, you will see the following output:


In this tutorial, I explained how you could add free and paid shipping methods on various products in the same shopping cart. I added two shipping classes and then added a code snippet to the functions.php. If you have any question about the topic of this tutorial, just leave a comment below.

Start Creating Web Apps on Managed Cloud Servers Now!

Easy Web App Deployment for Agencies, Developers and E-Commerce Industry

About Owais Alam

is the WordPress Community Manager at Cloudways – A Managed WooCommerce Hosting Platform and a seasoned PHP developer. He loves to develop all sorts of websites on WordPress and is in love with WooCommerce in particular. You can email him at

Stay Connected:

You Might Also Like...