One of the most powerful plugins for WooCommerce is Table Rate Shipping because it’s so configurable. You can create your own rules for bulk shipping, weight based shipping, or set up shipping zones and charge different rates for each zone. When someone requests their existing shipping method only support certain zones, or charge extra for specific zones we usually point them to Table Rate Shipping because that extension can do just about anything.
It would be nice if we could take some of the functionality of that plugin out and apply it to other shipping methods (like UPS, FedEx, USPS, etc.) but at WooThemes we’re very aware of feature creep and if we added these other feature the existing shipping methods would be bloated to the point of being unusable. So without adding a whole bunch of options that most users don’t want the best way to do this is to write a snippet of code to do this.
Only Ship to Continental United States
I decided to dig in and create a mini plugin for users to which checks which state they are in and then disables all shipping methods if the user isn’t in the continental United States. I’m including the plugin for you to look at the code but you can also go the plugins home page and download it, extract the zip file, and upload the folder to your
/wp-content/plugins/ directory of your site.
I’ve been doing support for WooCommerce for just about 6 months now and it’s still amazing to me how easy it is to change something using the giant list of hooks we have. For shipping methods especially there’s the
woocommerce_available_shipping_methods filter you can use to do modify them however you need.
Hopefully this plugin solves whatever needs you have and if not use that
woocommerce_available_shipping_methods hook and happy coding!