The Free Shipping method that comes with WooCommerce is pretty flexible. What it's not great at is allowing a store to mark one or two items to use free shipping for and leave the rest of the products to use your other shipping methods. We can use the shipping classes built into WooCommerce combined with a little bit of code to mark any number of products eligible for free shipping.
In order to enable free shipping on a per product basis, go through the following steps:
The first step is to create the shipping class we're going to use to mark items eligible for free shipping. If you don't know how to create shipping classes, see the Creating shipping classes recipe in this chapter.
Once you have a shipping class, you need to copy the shipping class Slug, which we can use to identify that shipping class in the code.
On the right-hand side of the Shipping Classes...