1
votes

I'm building a Woocommerce site and wondering if I can add a lookup to a custom form (postcode input only) which checks to see if the Postcode entered matches one that is in any of the Woo Shipping zones?

I have had a look to see if you can duplicate the shipping calculator to the homepage, from the Cart page as I assume this will have the same effect, but cannot see anything.

If the postcode is in a shipping zone, forward the user to the Shop page. If not, error message 'We do not deliver to this area'

1

1 Answers

0
votes

I was facing a similar issue I needed to check if the shop delivers to a given postcode. I used this post that helped me a lot.

You can use the wc_postcode_location_matcher to check if a postcode is in a given shipping zone. The only issue is (if I understand correctly) that the shipping zone has to be defined by postcodes.