How to Set Up Shipping Classes in WooCommerce
Set up WooCommerce shipping classes step by step: create classes, put them on products and variations, give each class its own cost in the flat rate, and avoid the mistakes that make shipping come out wrong.
Watch the tutorial
This tutorial sets up shipping classes from scratch in a fresh test shop, using only stock WooCommerce: creating classes, putting them on products and variations, flat rate class costs, Per class and Per order calculation, the no shipping class cost, and free shipping. The rates are tested at checkout. Then we go through three common mistakes. No code needed.
Also on YouTube (opens in a new tab)
Read the transcript
A 22 pound sack of coffee. A 12 ounce bag. And WooCommerce charges the same shipping for both. In this tutorial, we'll set up shipping classes, step by step. Create the classes, put them on products, and add class costs to flat rate shipping. It picks up where our shipping zones video left off, with the same demo shop. Then we'll test it at checkout, and go through the mistakes that make shipping come out wrong. It's all stock WooCommerce, so there's nothing extra to install.
First, what a shipping class is. It's a label that you put on products, to group them for shipping. A class has no price of its own. It isn't a zone, and it isn't a shipping method. The price comes from the flat rate method, which can charge extra for each class. So there are three steps. Create the classes, put them on products, and enter the costs in flat rate. Weight and size don't change the price by themselves. Without classes, a flat rate charges the same for a sack as for a bag.
Open WooCommerce, then Settings, then Shipping, and click the Classes tab. Click Add shipping class. Type a name, like Heavy items. The slug can stay empty, and WooCommerce makes one. Add a short description. WooCommerce asks for one, and only you see it. Then click Create. Do the same for Bulky items. A class belongs to the whole store, so you make it once, and use it in every zone.
Now put the classes on products. Open the sack, and go to the Shipping tab in Product data. Choose Heavy items in the Shipping class box. The weight and size above it are only information. Then click Update. A product can have just one class. For the roaster, we'll use Quick Edit in the product list. Choose Bulky items, and click Update. Bulk Edit has the same box, for changing many products at once. Back on the Classes tab, the product count shows one product in each class.
Variable products work too. This coffee comes in a 12 ounce bag, and a 5 pound bag. Open the product, go to Variations, and open the 5 pound variation. Its Shipping class box says Same as parent. Change it to Heavy items, and click Save changes. The 12 ounce variation stays on Same as parent. That means it uses the product's class, and this product has none.
Now the prices. Go to Shipping, open your zone, and edit the flat rate. The Cost box is the base price, $6 here. Every order pays it. Below that, each class has its own box. Bulky items is $20, and Heavy items is $10. Class costs are added to the base price. So a sack costs $6 plus $10, which is $16. Click Save. Class costs only exist in the flat rate method.
Let's try it as a customer. A bag of coffee has no class, so it ships for the plain $6. Now the sack. Its class adds $10, so shipping is $16.
What if a cart has two classes? This one has a sack, and a roaster. The flat rate adds each class once. $6, plus $10, plus $20, is $36. That's the Calculation type, set to Per class. Switch it to Per order, and save. Per order charges only the most expensive class. $6 plus $20 is $26.
There's one more box, No shipping class cost. It's for products that have no class. Enter $2, and save. A bag of coffee now ships for $6 plus $2, which is $8. Leave the box empty, and products with no class add nothing.
Free shipping is a separate method. This zone has one, for orders over $75. It doesn't look at classes at all. This cart has the sack, and a bag of coffee, $82 in all. The flat rate is $16, and free shipping is offered next to it. So a heavy order can still ship free. The minimum is checked after coupons. Apply a $10 coupon, the cart drops to $72, and free shipping disappears. To keep it, open the free shipping method, and tick Apply minimum order rule before coupon discount. Now the same cart gets free shipping again.
Mistake one. A class with no cost. The sack has its class, but the class cost box in the flat rate is empty. So the sack ships for the plain $6. WooCommerce adds nothing for a class that has no cost. Type the cost, and save. Now the sack ships for $16, as it should.
Mistake two. Class costs belong to one flat rate. Open the free shipping method, and there are no class costs. Only the flat rate has them. And every zone has its own flat rate. The Canada flat rate has empty class boxes, so the sack ships to Canada for $15, with nothing extra. Enter the class costs in each flat rate that needs them.
Mistake three. Expecting a charge for every item. A class cost is charged once for each class, not once for each item. Three sacks are in this cart, and shipping is still $16. To charge per item, type the cost, then a star, then qty in square brackets. Now each sack adds $10, and three sacks cost $36.
That's shipping classes. Create the classes, put them on products, and give each one a cost in flat rate. When shipping comes out wrong, check three things. Is the class on the product? Is the cost in this zone's flat rate? And is it Per class or Per order? One honest note. A class is a label that you set by hand on each product. WooCommerce can't price shipping from the weight of the cart. If you want that, PluginCity Shipping by Weight does it.
What you will learn
- What a shipping class is, and that it is a label and not a zone or a shipping method
- How to create classes and where they live in the settings
- How to put a class on a product, on a variation, and with Quick Edit (Bulk Edit has the same box)
- How the flat rate method adds a class cost on top of its base cost
- Calculation type: Per class adds each class once, Per order charges only the most expensive class
- The No shipping class cost box for products with no class
- That free shipping does not look at classes, and that its minimum is checked after coupons unless you tick Apply minimum order rule before coupon discount
- Three common mistakes: a class with no cost entered, class costs that only exist in the flat rate method of one zone, and expecting a charge for every item
- How to charge per item with a cost formula that uses the quantity
Good to know
Everything shown is stock WooCommerce (version 11.2 in this video) with no extra plugins, and screens may look slightly different in other versions. A shipping class is a label you set by hand on each product, and WooCommerce cannot price shipping from the weight of the cart. The last part of the video mentions the PluginCity Shipping by Weight for WooCommerce plugin, which prices a shipping method from weight bands, as an optional extra. Nothing in this tutorial needs it. Filmed on a demo shop (Ridgeline Coffee Roasters) with sample products and prices in US dollars. The voice-over is a computer-generated voice.
Related plugins
PluginCity plugins for related jobs.
