Hide a Shipping Method - Introduction
Shipping in WooCommerce is one of the areas that a lot of store owners struggle with. Often getting the base shipping rules set up is not too difficult, but some of the edge cases can be downright frustrating!
One question we get a lot in our support forum is around hiding specific shipping methods in certain situations.
For example, we recently had a store contact us that sells a variety of food items, some packaged but some are fresh cream. regular delivery is fine for the packaged items but the fresh cream cakes will spoil if they are delivered in 2-3 days. These fresh items need to be delivered overnight.
Setting up the shipping rates
In a normal shipping setup you might setup two different shipping methods:
First we’ll set up the standard shipping rates. In this example we will use price to calculate shipping. If the total cost is under $50 we will charge $4.99 shipping. If the total cost is $50 and above then this purchase ships for free.
So the settings will look like this
These are a typical type of shipping rules we see from our clients.
One thing worth pointing out, and is highlighted in the red box in the screenshot, is the ability to change the label that appears to the customer. In this case we want to highlight the fact that they are receiving free shipping. So instead of showing the ‘Standard 2-3 Days’ label we want to show ‘Free Shipping’. The plugin makes this easy, you can easily change the label when specific conditions are met.
We will also set up the overnight rates. In this example we will use similar pricing to the Standard shipping.
If the total cost is under $50 then we will charge $8.99 to ship overnight. If the cost is $50 and above then we will charge $5.99.
The shipping rules will look like this
What the customer will see at checkout
Now we have set up these shipping rules lets see what this experience will be like for the customer. There are 3 scenarios the customer can have:
- Only fresh products in their cart
- Only packaged products in the cart
- A combination of fresh AND packaged products in the cart
FRESH PRODUCTS ONLY
With just Fresh products in the cart we get both of the shipping methods displayed.
This is a problem as Fresh products need to ship overnight – they cannot ship using the standard method
PACKAGED PRODUCTS ONLY
When we have only packaged products in the cart we get the same shipping as just fresh
In this case this is perfect and exactly what we want – so all good here!
With the combination of Fresh and Packaged we again see both shipping methods displayed
This is incorrect – Standard shipping will not work as we have fresh products in the cart
How to Hide a Shipping Method
So as we can see there is a problem when a Fresh product is in the cart. We need to hide the Standard shipping.
How do we do this?
Well our Table Rate Shipping plugin has a feature that we can take advantage of. It is called the “SKIP” feature.
Basically what it does is if you have a rule that matches the items in the cart you can tell the plugin that you want to SKIP or ignore this shipping method. So we simply need to insert a new rule into the standard shipping. The rule should be: if you find a product in the cart with the shipping class of Fresh Cakes then skip this shipping method
It is important this rule is the at the top of the rules so it is evaluated first.
It would look like this
In this case now when we look at the cart with both fresh and packaged products we can see the Standard shipping method no longer is displayed. We can only see the Overnight method
If you recall (or scroll back) you will see we set up a custom label for free shipping. If the items in the cart exceeded $50 then free standard shipping was offered.
This is how that appears to a customer on your store
Where to get the plugin
You have seen just a few of the features available in our premium Table Rate Pro plugin.
It provides an easy and flexible way to set up shipping for your WooCommerce store.
The WooCommerce Table Rate Shipping plugin is ready for you and is available risk free with our 60 day, no hassle, money back guarantee