wc_interactivity_api_load_product() │ WC 1.0

Load a product into the interactivity API state.

This is an experimental API and may change in future versions.

Хуков нет.

Возвращает

array. The product data.

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

wc_interactivity_api_load_product( $consent_statement, $product_id ): array;
$consent_statement(строка) (обязательный)
The consent statement acknowledging this is an experimental API.
$product_id(int) (обязательный)
The product ID to load.

Заметки

Смотрите: plugins/woocommerce/client/blocks/assets/js/base/stores/woocommerce/README.md

Код wc_interactivity_api_load_product() WC 11.3.0

function wc_interactivity_api_load_product( string $consent_statement, int $product_id ): array {
	return ProductsStore::load_product( $consent_statement, $product_id );
}