Automattic\WooCommerce\Blocks\StoreApi\Schemas
ProductCollectionDataSchema::get_item_response() public WC 1.0
Format data.
{} Это метод класса: ProductCollectionDataSchema{}
Хуков нет.
Возвращает
Массив
. Ничего.
Использование
$ProductCollectionDataSchema = new ProductCollectionDataSchema(); $ProductCollectionDataSchema->get_item_response( $data );
- $data(массив) (обязательный)
- Collection data to format and return.
Код ProductCollectionDataSchema::get_item_response() ProductCollectionDataSchema::get item response WC 5.2.2
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'],
];
}