Categories
Development HTTP WooCommerce Wordpress

How to get WooCommerce zone location name from shipping zone object

I am creating a plugin for WooCommerce and I need to retrieve the values that are specified in WooCommerce shipping zone region settings:

woocommerce settings

I’ve created a foreach loop that retrieves all the shipping zones and in there I’ve created another foreach loop that retrieves all the values that are specified in the postcode field. If I output $value->type it does give me the type of ‘postcode’. But now I need to get the actual value.

foreach( $delivery_zones as $key => $the_zone ) {
    foreach ($the_zone['zone_locations'] as $key => $value) {
        // NEED TO ECHO THE VALUE OF THE POSTCODE HERE
    }
}

I would appreciate any help that I could get with this!

Leave a Reply

Your email address will not be published. Required fields are marked *