WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Schemas

CartShippingRateSchema::get_item_response() public WC 1.0

Convert a shipping rate from WooCommerce into a valid response.

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

No Hooks.

Return

Array.

Usage

$CartShippingRateSchema = new CartShippingRateSchema();
$CartShippingRateSchema->get_item_response( $package );
$package(array) (required)
Shipping package complete with rates from WooCommerce.

Code of CartShippingRateSchema::get_item_response() WC 5.7.0

public function get_item_response( $package ) {
	return [
		'package_id'     => $package['package_id'],
		'name'           => $package['package_name'],
		'destination'    => $this->prepare_package_destination_response( $package ),
		'items'          => $this->prepare_package_items_response( $package ),
		'shipping_rates' => $this->prepare_package_shipping_rates_response( $package ),
	];
}