WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта
функция не описана

Automattic\WooCommerce\Internal\ProductAttributesLookup

LookupDataStore::update_data_for_product() public WC 1.0

Insert or update the lookup data for a given product or variation. If a variable product is passed the information is updated for all of its variations.

{} Это метод класса: LookupDataStore{}

Хуков нет.

Возвращает

null. Ничего.

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

$LookupDataStore = new LookupDataStore();
$LookupDataStore->update_data_for_product( $product );
$product(int|WC_Product) (обязательный)
Product object or id.

Код LookupDataStore::update_data_for_product() WC 5.5.2

<?php
public function update_data_for_product( $product ) {
	// TODO: For now data is always deleted and fully regenerated, existing data should be updated instead.

	if ( ! is_a( $product, \WC_Product::class ) ) {
		$product = WC()->call_function( 'wc_get_product', $product );
	}

	if ( $this->is_variation( $product ) ) {
		throw new \Exception( "LookupDataStore::update_data_for_product can't be called for variations." );
	}

	$this->delete_lookup_table_entries_for( $product->get_id() );

	if ( $this->is_variable_product( $product ) ) {
		$this->create_lookup_table_entries_for_variable_product( $product );
	} else {
		$this->create_lookup_table_entries_for_simple_product( $product );
	}
}