php - WooCommerce get order shipping address as separate fields -
i'm building woocommerce plugin sends orders 3rd party api.
however, have found there isn't way individual fields/properties of order shipping address since woocommerce v2.3. function available
get_formatted_shipping_address()
which returns string , seems function returns address array "get_shipping_address()" has been deprecated in version 2.3.
does know way shipping address array order? don't want resort using old version of woocommerce. perhaps there hook, action or class override can use achieve this?
i got shipping address in simple way :
function get_shipping_zone(){ global $woocommerce; $customer = new wc_customer(); $post_code = $woocommerce->customer->get_shipping_postcode(); $zone_postcode = $woocommerce->customer->get_shipping_postcode(); $zone_city =get_shipping_city(); $zone_state = get_shipping_state(); } you can print_r "$woocommerce->customer" meta data may need, useful know it.
Comments
Post a Comment