Automattic\WooCommerce\Internal\ProductFeed\Mapping

UcpProductMapper::map_product │ public │ WC 1.0

Map a product to the UCP catalog product shape.

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

Хуков нет.

Возвращает

array. The mapped product data.

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

$UcpProductMapper = new UcpProductMapper();
$UcpProductMapper->map_product( $product, $required_variation_ids, $only_required ): array;
$product(WC_Product) (обязательный)
The product to map.
$required_variation_ids(массив)
Variation ids the request named directly, which the per-product variant cap must not drop.
По умолчанию: array()
$only_required(true|false)
Build only the named variations, because the caller will discard everything else.
По умолчанию: false

Код UcpProductMapper::map_product() WC 11.3.0

public function map_product( \WC_Product $product, array $required_variation_ids = array(), bool $only_required = false ): array {
	return $this->map_item( $product, $this->item( $product ), $required_variation_ids, $only_required );
}