Automattic\WooCommerce\StoreApi\Schemas\V1\Agentic

CheckoutSessionSchema::format_fulfillment_addressprotectedWC 1.0

Format fulfillment address.

Method of the class: CheckoutSessionSchema{}

No Hooks.

Returns

Array|null. Address data or null.

Usage

// protected - for code of main (parent) or child class
$result = $this->format_fulfillment_address();

CheckoutSessionSchema::format_fulfillment_address() code WC 10.8.1

protected function format_fulfillment_address() {
	$customer = WC()->customer;

	if ( ! $customer || ! $customer->get_shipping_address_1() ) {
		return null;
	}

	return $this->build_address_array(
		$customer->get_shipping_first_name(),
		$customer->get_shipping_last_name(),
		$customer->get_shipping_address_1(),
		$customer->get_shipping_address_2(),
		$customer->get_shipping_city(),
		$customer->get_shipping_state(),
		$customer->get_shipping_country(),
		$customer->get_shipping_postcode()
	);
}