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

WC_Product_Variable::sync() WC 1.0

Sync a variable product with it's children. These sync functions sync upwards (from child to parent) when the variation is saved.

Это метод класса: WC_Product_Variable

Хуки из метода
Возвращает

WC_Product. Synced product object.

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

$var = WC_Product_Variable::sync( $product, $save );
$product(WC_Product/число) (обязательный)
Product object or ID for which you wish to sync.
$save(true/false)
If true, the product object will be saved to the DB before returning it.
По умолчанию: true

Код WC Product Variable::sync: woocommerce/includes/class-wc-product-variable.php WC 3.6.3

<?php
public static function sync( $product, $save = true ) {
	if ( ! is_a( $product, 'WC_Product' ) ) {
		$product = wc_get_product( $product );
	}
	if ( is_a( $product, 'WC_Product_Variable' ) ) {
		$data_store = WC_Data_Store::load( 'product-' . $product->get_type() );
		$data_store->sync_price( $product );
		$data_store->sync_stock_status( $product );
		self::sync_attributes( $product ); // Legacy update of attributes.

		do_action( 'woocommerce_variable_product_sync_data', $product );

		if ( $save ) {
			$product->save();
		}

		wc_do_deprecated_action(
			'woocommerce_variable_product_sync', array(
				$product->get_id(),
				$product->get_visible_children(),
			), '3.0', 'woocommerce_variable_product_sync_data, woocommerce_new_product or woocommerce_update_product'
		);
	}

	return $product;
}