Tutorials for setting up free shipping for a single product typically include the following steps:
- Creating a new Shipping Class under WooCommerce > Settings > Shipping > Shipping Classes > Add Shipping Class, typically called “Free Shipping”.
- Assigning the new Shipping Class to the individual product under Product data > Shipping > Shipping Class
- Setting up a Flat Rate shipping method based on the Shipping Class under WooCommerce > Settings > Shipping > Shipping Zones.
However, in setting up this flat rate, it is assumed there is a flat rate shipping cost for all of the other products. This was not the case for a store I was administering.
This store had a variety of shipping methods, such as USPS and UPS and several services within each of those shipping methods. The requirement was to calculate standard shipping costs for all products based on the selection of the customer, except for one product which should ship as a flat rate with no shipping costs. This one product was a protective face mask in response to COVID-19.
So, there were several scenarios:
- If the protective face mask was the only item in the cart, regardless of quantity, then the flat-rate shipping method would be the only option available.
- If the cart included anything else, then the shipping costs would be calculated based on the combination of all the products in the cart, except for the protective face mask, provided the protective face mask was also in the cart.
- If the cart included anything but the protective face mask, calculate the shipping based on the selection of the customer.
To accomplish this, we did have to turn to a premium plugin — WooCommerce Conditional Shipping and Payments for $79 billed annually.
Even then, the specific configuration was elusive.
First, a product category was specifically created for the protective face mask. Only the protective face mask was assigned to the category. This was to accommodate the conditions available in the Conditional Shipping and Payments plugin.
Ultimately, two global restrictions were created based on Shipping Methods:
1. Flat rate, in which all USPS and UPS shipping methods were excluded, thereby leaving flat rate as the only allowed shipping method. Then, a condition in which the “Category” for “all items in package” for the “Protective Face Mask” category was added.
2. Remove flat rate, in which the Flat Rate method was excluded, thereby leaving USPS and UPS shipping methods. Then, a condition in which “Shipping Class” “in package” for “Standard shipping” was added.
Now, the problem was that the store contained hundreds of products. With the protective face mask assigned to the “Free shipping” shipping class, we needed to assign all of the other existing products to the “Standard shipping” shipping class.
Bulk actions to the rescue. On the product listing page, selecting multiple products and choosing “Edit” from the “Bulk Actions” dropdown, you can change shipping class quickly and easily.
With that, we got the exact configuration my client was looking for. Again, the distinction for our use case was that all of the other products, except for the protective face mask, are not assigned a flat rate. This caused the deviation from the other tutorials and required the purchase of the premium plugin.
I hope this helps someone else out there…