WC_Customer::has_shipping_address()publicWC 5.3.0

Indicates if the customer has a non-empty shipping address.

Note that this does not indicate if the customer's shipping address is complete, only that one or more fields are populated.

Method of the class: WC_Customer{}

No Hooks.




$WC_Customer = new WC_Customer();


Since 5.3.0 Introduced.

WC_Customer::has_shipping_address() code WC 7.7.0

public function has_shipping_address() {
	foreach ( $this->get_shipping() as $address_field ) {
		// Trim guards against a case where a subset of saved shipping address fields contain whitespace.
		if ( strlen( trim( $address_field ) ) > 0 ) {
			return true;

	return false;