If you have already read How to Set Up WooCommerce Shipping for Specific Countries, the built-in WooCommerce feature can only limit checkout to the country level. The problem is that many stores can only serve specific areas, such as Jabodetabek, due to shipping costs or delivery capacity.
For this case, we cannot rely on Selling location alone. We need to go into the Shipping Zonesfeature, which is designed to manage shipping based on specific regions, not just countries.
Quick summary: To limit WooCommerce shipping only to Jabodetabek, first limit Selling location(s) to Indonesia only (see previous tutorial), then create a new Shipping Zone named “Jabodetabek” in WooCommerce > Settings > Shipping, fill in Zone regions with DKI Jakarta, West Java, and Banten, add a Shipping method (Flat rate), and make sure the default “Locations not covered” zone is left empty so other regions do not get shipping options.
How to Limit WooCommerce Sales to Specific Provinces
Make sure WooCommerce is active and you are logged into WP Admin, then follow these steps.
1. Limit Selling Location to Indonesia
Before going into Shipping Zones, first limit sales to Indonesia via WooCommerce > Settings > General. Change Selling location(s) to Sell to specific countries, then select Indonesia. Also change Shipping location(s) to Ship to all countries you sell to.
This step is important so that the Shipping Zone we create later only needs to focus on managing regions within Indonesia, without needing to worry about other countries.
2. Open the Shipping Zones Menu
Still on the WooCommerce Settings page, click the Shippingtab. You will see a list of existing Shipping Zones, which is usually empty or only contains the default zone.
3. Add a New Shipping Zone
Click the Add shipping zonebutton. Fill in the following fields:
- Zone name: fill with
Jabodetabek. - Zone regions: search for and select the Jabodetabek location (
DKI Jakarta,Jawa Barat, andBanten.)
These Zone regions are what distinguish a Shipping Zone from just a Selling location. Here you can drill down to the province level, not just the country level.
4. Add a Shipping Method for the Jabodetabek Zone
Still on the same page, scroll to the Shipping methodssection, click Add shipping method. Select Flat rate for a flat rate.
After the method is added, click the edit icon to set:
- Method title: fill with
Ongkir Jabodetabek. - Cost: enter the shipping fee amount, for example
15000, or you can also set it to free shipping.
Make sure the method status is enabled, then click Save changes.
5. Leave the Default Zone Empty So Other Regions Cannot Checkout
WooCommerce automatically provides a default zone named Rest of the world. This zone holds all addresses that do not fall into any zone you have created.
So that buyers outside of Jabodetabek cannot checkout, do not add any shipping methods to this default zone. If there is no suitable shipping method, WooCommerce will automatically reject the checkout process and display a message that shipping is not available.
6. Save and Test Checkout
After all zones and methods are set up, perform a test from the buyer's perspective:
- Add a product to the cart, then open the checkout page with an address in Jakarta. Make sure the Jabodetabek Shipping.
- option appears. Change the address to another province, for example East Java or North Sumatra. Make sure no shipping methods appear.
- If the result is as expected, then the sales restriction based on province is working.
That is an easy way to limit WooCommerce sales to specific provinces, which can be useful if you want to sell products only to a few provinces first.
Additional Notes
- Shipping Zones are matched based on the customer's shipping address, not the product or store location. The order of zones on the Shipping Zones page also matters. WooCommerce will match the customer's address to the top-most matching zone, so arrange the zones from the most specific to the most general.
- Zone regions actually also support zip codes. Below the province field, there is a separate column to enter zip codes, supporting wildcards (
CB23*) as well as numeric ranges (90210...99000). This method can be used if you need coverage that is more precise than a province. But because many zip codes in Indonesia overlap between cities/regencies, this method is more prone to coverage errors and is not discussed in detail in this tutorial. - This feature is built into WooCommerce, no additional plugin is needed. If you need automatic shipping calculations based on distance or weight (not flat rate), then you need an additional shipping cost plugin such as a local courier shipping plugin.
- This restriction applies per store, not per product. If there are certain products that can still be shipped throughout Indonesia while other products are restricted, you need an additional shipping restriction plugin that supports per-product settings.
FAQ
Can buyers outside of Jabodetabek still see products?
Yes. Shipping Zone settings only affect shipping options during checkout, not product visibility in the catalog.
Do I need to install an additional shipping plugin?
Not mandatory. For flat rate or local pickup needs like in this tutorial, the built-in WooCommerce feature is sufficient. Additional plugins are only needed if you need automatic shipping calculations from an expedition service.
Can Shipping Zones be combined with country restrictions?
Yes, and it is actually recommended. First, limit Selling location(s) to Indonesia as in step 1, then set up Shipping Zones for more specific restrictions within Indonesia.
COMMENTS
Loading...