This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

CloudwaysCDN — a powerful solution that offers superior performance and satisfied global audience for your business. Read More

Add Multiple Shipping Methods On WooCommerce Cart Pages

Updated on  28th March

3 Min Read
Reading Time: 3 minutes

In this article, I will explain how to use different WooCommerce hosted store 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:

Conclusion

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.

Share your opinion in the comment section. COMMENT NOW

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 owais.alam@cloudways.com

Start Growing with Cloudways Today.

Our Clients Love us because we never compromise on these

Get Our Newsletter
Be the first to get the latest updates and tutorials.

THERE’S MORE TO READ.