WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Schemas

CartShippingRateSchema::prepare_package_destination_response() protected WC 1.0

Gets and formats the destination address of a package.

{} It's a method of the class: CartShippingRateSchema{}

No Hooks.

Return

Object.

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_package_destination_response( $package );
$package(array) (required)
Shipping package complete with rates from WooCommerce.

Code of CartShippingRateSchema::prepare_package_destination_response() WC 5.8.0

protected function prepare_package_destination_response( $package ) {
	return (object) $this->prepare_html_response(
		[
			'address_1' => $package['destination']['address_1'],
			'address_2' => $package['destination']['address_2'],
			'city'      => $package['destination']['city'],
			'state'     => $package['destination']['state'],
			'postcode'  => $package['destination']['postcode'],
			'country'   => $package['destination']['country'],
		]
	);
}