woocommerce_variation_before_set_stock
woocommerce_variation_before_set_stock
Appears in: woocommerce.4.9.0, woocommerce.4.9.1, woocommerce.4.9.2, woocommerce.5.0.0, woocommerce.5.1.0, woocommerce.5.2.0, woocommerce.5.2.1, woocommerce.5.2.2, woocommerce.5.3.0, woocommerce.5.4.0, woocommerce.5.4.1, woocommerce.5.5.0, woocommerce.5.5.1, woocommerce.5.5.2, woocommerce.5.6.0, woocommerce.5.6.1, woocommerce.5.7.0, woocommerce.5.7.1, woocommerce.5.8.0, woocommerce.6.3.1, woocommerce.6.4.1, woocommerce.6.5.1, woocommerce.6.6.1, woocommerce.6.7.0, woocommerce.6.8.0, woocommerce.6.8.1, woocommerce.6.8.2, woocommerce.6.9.0, woocommerce.6.9.4, woocommerce.7.0.0, woocommerce.7.1.0, woocommerce.7.1.1, woocommerce.7.2.2, woocommerce.7.3.0, woocommerce.7.4.0, woocommerce.7.4.1, woocommerce.7.5.1, woocommerce.7.6.0, woocommerce.7.6.1, woocommerce.7.7.0, woocommerce.7.7.1, woocommerce.7.8.1, woocommerce.7.9.0, woocommerce.8.0.3, woocommerce.8.1.1, woocommerce.8.2.1, woocommerce.8.2.2, woocommerce.8.3.1, woocommerce.8.4.0, woocommerce.8.5.1, woocommerce.8.5.2, woocommerce.8.6.0, woocommerce.8.6.1, woocommerce.8.7.0, woocommerce.8.8.3, woocommerce.8.9.2, woocommerce.8.9.3, woocommerce.9.0.2, woocommerce.9.1.2, woocommerce.9.1.4, woocommerce.9.2.2, woocommerce.9.2.3, woocommerce.9.3.1, woocommerce.9.3.3, woocommerce.9.4.2, woocommerce.9.4.3, woocommerce.9.5.1
Hook Type: action
Displaying hooks found in version: woocommerce.9.5.1do_action('woocommerce_variation_before_set_stock') is found 2 times:
- /includes/data-stores/class-wc-product-data-store-cpt.php line 719
* @since 4.9 * * @param int $product The variation whose stock is about to change. */ do_action( 'woocommerce_variation_before_set_stock', $product ); } else { /** * Action to signal that the value of 'stock_quantity' for a product is about to change. * * @since 4.9 *
- /includes/wc-stock-functions.php line 47
// Fire actions to let 3rd parties know the stock is about to be changed. if ( $product_with_stock->is_type( 'variation' ) ) { // phpcs:disable WooCommerce.Commenting.CommentHooks.MissingSinceComment /** This action is documented in includes/data-stores/class-wc-product-data-store-cpt.php */ do_action( 'woocommerce_variation_before_set_stock', $product_with_stock ); } else { // phpcs:disable WooCommerce.Commenting.CommentHooks.MissingSinceComment /** This action is documented in includes/data-stores/class-wc-product-data-store-cpt.php */ do_action( 'woocommerce_product_before_set_stock', $product_with_stock ); }