Creating shipping classes allows you to set different shipping amounts for different types of products. Once you attach a shipping class to a product, WooCommerce will add the shipping charge to the checkout screen.
Step 1 — Create a Shipping Class
- Log in to your website.
- Using the menu on the left side of the WordPress dashboard, go to WooCommerce → Settings.
- Click the Shipping tab (just below “Settings” at the top).
- Click Classes (above the “Shipping zones” table).
- Click the Add shipping class button (to the right of the “Shipping classes” title).
- Enter:
- Shipping Class — the name you give to identify the shipping class, e.g.:
Book or Large Bottle - Slug — this will fill automatically, so you can skip it.
- Description — optional.
- Shipping Class — the name you give to identify the shipping class, e.g.:
- Click the Create button.
At this point, you will be on the Shipping Classes screen, where you see the entire list of shipping classes, including the one you just created.
Step 2 — Set the Shipping Price for the Class
While still in the WooCommerce settings under “Shipping” (from the step above), do the following:
- Click Shipping Zones.
- Click Edit on the right side of the first shipping zone row, “United States (USA).”
- You may edit an existing shipping method, but if you just added a new shipping class, you probably do not want to edit the “UPS Shipping” for bottles. Instead, click the Add shipping method button below the table of existing shipping methods.
- Click Flat rate in the box that pops up.
- Click the Continue button.
- In the next box that opens up, the name will default to “Flat rate.” This is what the customer will see. In most cases, you will want to change that to something a bit more descriptive, such as: Book flat rate
- Click on the box immediately below “Tax status” and change it to None.
- Enter the shipping cost under “Cost.”
- Optional: Add an additional charge based on shipping class and other factors in the relevant “Shipping class costs” field(s).
Step 9, above, may be a little confusing at first. Its purpose is to allow calculations based on quantity (along with a few other possibilities). For example, if the shipping charge for books is $5 for the first book and $0.50 for each additional book, you could create a formula where [qty] is a variable representing the actual quantity the customer is ordering, as follows:
If the customer is only ordering one book, the formula will evaluate to:
For two books, it will be:
By the way, an equivalent formula is:
When is 1, will be zero, better reflecting the description, “$5 for the first book and 50 cents for each additional book.”
Note that if you also enter an amount in the “Cost” field (Step 8 above), that amount will be added to the end result of any formula you put under a relevant class cost (Step 9). We could get the same shipping cost end result by entering 5 in the “Cost” field and then just in the relevant shipping class cost field below that.
Step 3 — Assign a Shipping Class to a Product
Next, tell WooCommerce which product(s) belong to the new class.
- From the dashboard menu on the left, choose: Products → All Products.
- Click Edit on the product.
- Scroll down to the Product data box.
- Click the Shipping tab inside that box (left side).
- Cllick the Shipping Class dropdown.
- Select the shipping class you created earlier.
- Click Publish if the product was previously saved as a draft or Save draft if you want to keep it in draft status. If it has already been published, click Update to save the new changes.
Repeat for any other products that need special shipping.
