WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Schemas

ProductCollectionDataSchema::get_item_response() public WC 1.0

Format data.

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

No Hooks.

Return

Array.

Usage

$ProductCollectionDataSchema = new ProductCollectionDataSchema();
$ProductCollectionDataSchema->get_item_response( $data );
$data(array) (required)
Collection data to format and return.

Code of ProductCollectionDataSchema::get_item_response() WC 5.7.1

public function get_item_response( $data ) {
	return [
		'price_range'      => ! is_null( $data['min_price'] ) && ! is_null( $data['max_price'] ) ? (object) $this->prepare_currency_response(
			[
				'min_price' => $this->prepare_money_response( $data['min_price'], wc_get_price_decimals() ),
				'max_price' => $this->prepare_money_response( $data['max_price'], wc_get_price_decimals() ),
			]
		) : null,
		'attribute_counts' => $data['attribute_counts'],
		'rating_counts'    => $data['rating_counts'],
	];
}