Zone processing override for Local Pickup
-
Woocommerce Zone processing does not allow for a local pickup option when customers are not shipping. We have customers from other countries who enter their address for purchasing. The only way to enable a zone for local pickup is if “Ship to specific countries” has the country of the billing address. For actual shipping, we only allow shipping in the US.
Woocommerce has a function in wc-core-functions.php called wc_get_shipping_zone. In fact wc-core-functions.php checks to see if that function is defined before it defines the default. I could create my own zone processing if I can define my own wc_get_shipping_zone function. It would first call WC_Shipping_Zones::get_zone_matching_package( $package ); and if there were no match would default to zone_id = 0, the Locations not covered by your other zones option. Ideally this should be the case anyway. But the current implementation does not select any zones that are not including in the Ship to specific countries setting. I don’t want all countries in that setting because then they appear as possible countries to ship to on the checkout form.Woocommerce core should always default to zone_id 0 if no other zones are selected. Alternatively, Woocommerce can add a filter after WC_Shipping_Zones::get_zone_matching_package( $package ); where I can force zone_id 0.
I consider this a bug. This is the first time I’ll have to alter a core woocommerce file (i.e. not a template) to get what I consider obvious. The ability to always have my Local Pickup processing called.
The page I need help with: [log in to see the link]
- The topic ‘Zone processing override for Local Pickup’ is closed to new replies.