woocommerce_variation_set_stock хук-событиеWC 3.0

Action to signal that the value of 'stock_quantity' for a variation has changed.

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

add_action( 'woocommerce_variation_set_stock', 'wp_kama_woocommerce_variation_set_stock_action' );

/**
 * Function for `woocommerce_variation_set_stock` action-hook.
 * 
 * @param WC_Product $product The variation whose stock has changed.
 *
 * @return void
 */
function wp_kama_woocommerce_variation_set_stock_action( $product ){

	// action...
}
$product(WC_Product)
The variation whose stock has changed.

Список изменений

С версии 3.0 Введена.

Где вызывается хук

WC_Product_Data_Store_CPT::handle_updated_props()
woocommerce_variation_set_stock
wc_update_product_stock()
woocommerce_variation_set_stock
woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php 756
do_action( 'woocommerce_variation_set_stock', $product );
woocommerce/includes/wc-stock-functions.php 69
do_action( 'woocommerce_variation_set_stock', $product_with_stock );

Где используется хук в WooCommerce

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