Automattic\WooCommerce\Internal\ProductFeed\Mapping

UcpProductMapper::item │ private │ WC 1.0

Build the Store API item response for a product or variation, as nested arrays.

Метод класса: UcpProductMapper{}

Хуков нет.

Возвращает

array.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->item( $product ): array;
$product(WC_Product) (обязательный)
WooCommerce product.

Код UcpProductMapper::item() WC 11.3.0

private function item( \WC_Product $product ): array {
	// Nested values are stdClass; decode through JSON for uniform array access.
	return (array) json_decode( (string) wp_json_encode( $this->schema()->get_item_response( $product ) ), true );
}