Setting up shipping rates in WooCommerce Core can be done with some flexibility based on the country, state and zip-/postcode of the customer. If you however have the requirement to setup shipping rates on a the value of a custom checkout field you’ll have to find another way.
Creating a Shipping Area Custom Field
First we’d need to have a custom field we’d want the shipping rates to be based upon. You can use a plugin like Advanced Checkout Fields to setup a custom field if you have a bit more complicated requirement or want a User Interface (UI) to setup checkout fields. For this post I’ll use a small code snippet to setup a custom checkout field.
This will add a ‘Shipping Area’ dropdown to the shipping fields section with the selectable options as entered within the code.

Setting Shipping Rates Based on The Custom Shipping Field
The next step is to setup shipping rates based on the created custom field. For this I’m going to use the Advanced Shipping for WooCommerce plugin. For that plugin I’ll show how you can create a custom condition that adds the ‘Shipping area’ shipping field. This way you’ll have full flexibility on how you’d want to setup your shipping rates and cost.
The following code will add a custom condition to the Advanced Shipping plugin.
When implemented it should add the ‘Shipping area’ condition to the list in Advanced Shipping.

As you can see the custom condition we’ve created has a dropdown as a value field. Depending on your requirements you may want to change this to a text field so you can enter a comma separated list of values instead of having to select shipping areas one by one separately.
Setting up Shipping Rates Based on the Shipping Area Field
The final step would be to setup your shipping rates with the custom condition based on the custom ‘Shipping area’ checkout field. This is the easiest step to complete.
When adding / testing shipping rates, be sure to enable the Shipping Debug Mode in the ‘WooCommerce’ > ‘Settings’ > ‘Shipping’ > ‘Shipping Options’ section. That will disable the shipping cache, preventing from showing you cached shipping rates that aren’t changes according to the changes you’re making.
Setting a shipping rate based on the custom field

Shipping rates excluding custom areas
