Case study
Let’s assume you run a shop and want to boost your sales by offering the free shipping for the specific products. What’s more you want to hide the other shipping methods if the products shipped for free are in the cart.
How to configure such a scenario where the shipping is free only for certain products and when they are in the cart no other shipping methods should be displayed?
Plugin configuration
- Navigate to WooCommerce → Settings → Shipping → Shipping Classes → Add Shipping Class and create a new shipping class called Free shipping:
- Assign it to the products you want to be shipped for free:
- Return to the Flexible Shipping shipping method configuration screen, add the shipping cost calculation rule based on Shipping Class and set:
- When: Shipping Class
- matches any of: Free shipping
- rule cost is: 0
Result
When your customer adds a product with Free shipping shipping class assigned a $0 cost shipping method is displayed which equals shipping it for free.
Disabling other shipping methods if there’s a product with a specific shipping class in the cart
If you want your other shipping methods to disappear when there’s a product with Free shipping shipping class in the cart, please add the following rule at the very top of their rules tables:
- When: Shipping Class
- matches any of: Free shipping
- Special action: Hide
It will result in displaying only the free shipping shipping method in the cart/checkout when a customer adds a product with Free shipping shipping class to his cart. Other shipping methods will remain hidden.