Selling physical products? You need to ship them!
To set up shipping in WooCommerce, you first set up shipping zones, then add methods to those zones, and lastly, rates to your methods. You can create as many zones as you like, and add multiple methods and rates to each zone.
Shipping Zones
A Shipping Zone is a geographical area to which you ship items. You can get as specific as you need, right down to regions and zip codes, or you can leave it more general – whichever suits you best.
Customers only see the methods available for their address and corresponding zone. Each customer matches only one zone.
For example, you could create these zones in WooCommerce:
ZONE NAME | REGION | SHIPPING METHODS |
---|---|---|
Local | California ZIP 90210 | Local pickup |
Domestic | All US states | 2 Flat rates named “standard” and “priority” |
Europe | Countries in Europe | Flat rate shipping |
Add as many zones as you need, with each zone containing multiple shipping methods.
Adding and managing zones
To set up shipping zones, go to: WooCommerce > Settings > Shipping. If you don’t see Shipping as an option, go back to WooCommerce > General and take a look at settings at Shipping Location(s) – you may need to enable shipping settings there!
The first time you visit WooCommerce > Settings > Shipping, there is a prompt to add a new zone, and a default zone.
Locations not covered by your other zones is used for customers who do not match any of the custom zones you add. Adding methods to this zone is completely optional, depending on your needs.
Since zones match from top to bottom, you can also exclude regions from shipping by adding a zone for that region and assigning no shipping methods to it.
Adding a new zone
- Go to: WooCommerce > Settings > Shipping > Shipping Zones.
- Select Add shipping zone at the top.
- Enter a descriptive Zone Name, and select Zone Regions that apply. Regions can consist of: a) Countries, b) States, c) Continents.
- Select Limit to specific zip/postcodes (if applicable) to further narrow which customers match this zone. For example, you can set a local zone with a specific set of postcodes (one per line); a range of postcodes (e.g. 90210…99000), or use wildcards (e.g. CB23*).
- Select which Shipping Methods are available to this zone.
- Save changes.
In the below example, we created three zones – Local, Domestic, and North America – to demonstrate how zones can be set up.
Sorting shipping zones
Shipping zones match customer address from top to bottom — the first to match the customer address is always used. If no custom zones match, then Locations not covered by your other zones is used.
To sort and reorder zones:
- Go to: WooCommerce > Settings > Shipping > Shipping Zones.
- Hover and click on the far left handles. A four-point icon appears on the screen.
- Drag and drop.
Editing shipping zones
To edit a shipping zone:
- Go to: WooCommerce > Settings > Shipping > Shipping Zones.
- Hover over Zone Name, and the option to Edit and Delete appear.
- Select Edit, and a screen appears so you can change the name, regions or shipping methods.
- Save changes.
To delete a shipping zone:
- Go to: WooCommerce > Settings > Shipping > Shipping Zones.
- Hover over Zone Name, and the option to Edit and Delete appear.
- Select Delete, and the Shipping Zone is deleted.
Adding shipping methods to zones
To add a shipping method to an existing Shipping Zone:
- Go to: WooCommerce > Settings > Shipping > Shipping Zones.
- Hover over the Shipping Zone you wish to change, and select Edit.
- Scroll down to Shipping Methods on the screen that appears.
- Disable an existing Shipping Method by using the button. Or select Add Shipping method to use a different one.
- Save changes.
For more information about configuring the core shipping methods, see the following related docs:
Local Pickup | Documentation |
Flat Rate Shipping | Documentation |
Free Shipping | Documentation |
Removing shipping methods from zones
To remove a shipping method from a Shipping Zone:
- Go to: WooCommerce > Settings > Shipping > Shipping Zones.
- Hover over the Shipping Zone you wish to change, and select Edit.
- Scroll down to Shipping Methods on the screen that appears.
- Hover over the Shipping Method you wish to remove, and select Delete.
- Save changes.
Control the shipping method selected by default
The default Shipping Method for customers is the top listed, enabled shipping method in the zone that they match.
In this screenshot example, Local Pickup is chosen for customer that matched the Local Shipping Zone.
Drag and drop to reorder shipping methods using the handles on the left, then Save Changes.
You can also control how shipping methods are ordered in the cart page, in the same screen. All the selected shipping methods will be sorted in the cart page, in the same order you followed, to arrange them in this screen.
For customers matching the Local shipping zone parameters, shipping methods appear in the cart in the same order:
How zones work for customers
Using these shipping zones and methods:
- In the 90210 zip code in California, I offer Local Pickup and Free Shipping.
- In the United States, I offer a Domestic Flat Rate.
- In Canada and U.S. regions, I offer a different Flat Rate.
This is what your customers would see if they use the Calculate Shipping option:
CALIFORNIAN CUSTOMER | NON-CALIFORNIAN, U.S. CUSTOMER | INTERNATIONAL CUSTOMER |
---|---|---|
Customization
Snippet: Only show free shipping if available
By default, all methods in a zone are presented to the customer. If you have conditional free shipping and want it to be the only shown method if it’s available, you can use the following snippet to hide other methods:
<?php | |
/** | |
* Hide shipping rates when free shipping is available. | |
* Updated to support WooCommerce 2.6 Shipping Zones. | |
* | |
* @param array $rates Array of rates found for the package. | |
* @return array | |
*/ | |
function my_hide_shipping_when_free_is_available( $rates ) { | |
$free = array(); | |
foreach ( $rates as $rate_id => $rate ) { | |
if ( ‘free_shipping’ === $rate->method_id ) { | |
$free[ $rate_id ] = $rate; | |
break; | |
} | |
} | |
return ! empty( $free ) ? $free : $rates; | |
} | |
add_filter( ‘woocommerce_package_rates’, ‘my_hide_shipping_when_free_is_available’, 100 ); |