Automattic\WooCommerce\StoreApi\Routes\V1

CartUpdateCustomer::get_customer_billing_address()protectedWC 1.0

Get full customer billing address.

Method of the class: CartUpdateCustomer{}

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_customer_billing_address( $customer );
$customer(\WC_Customer) (required)
Customer object.

CartUpdateCustomer::get_customer_billing_address() code WC 9.3.3

protected function get_customer_billing_address( \WC_Customer $customer ) {
	$additional_fields = $this->additional_fields_controller->get_all_fields_from_object( $customer, 'billing' );

	return array_merge(
		[
			'first_name' => $customer->get_billing_first_name(),
			'last_name'  => $customer->get_billing_last_name(),
			'company'    => $customer->get_billing_company(),
			'address_1'  => $customer->get_billing_address_1(),
			'address_2'  => $customer->get_billing_address_2(),
			'city'       => $customer->get_billing_city(),
			'state'      => $customer->get_billing_state(),
			'postcode'   => $customer->get_billing_postcode(),
			'country'    => $customer->get_billing_country(),
			'phone'      => $customer->get_billing_phone(),
			'email'      => $customer->get_billing_email(),
		],
		$additional_fields
	);
}