woocommerce_variation_set_stock

woocommerce_variation_set_stock

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

do_action('woocommerce_variation_set_stock') is found 2 times:

  • /includes/data-stores/class-wc-product-data-store-cpt.php line 832
    				 * @since 3.0
    				 *
    				 * @param WC_Product $product The variation whose stock has changed.
    				 */
    				do_action( 'woocommerce_variation_set_stock', $product );
    			} else {
    				/**
    				 * Action to signal that the value of 'stock_quantity' for a product has changed.
    				 *
    				 * @since 3.0
    				 *
    
  • /includes/wc-stock-functions.php line 69
    		// Fire actions to let 3rd parties know the stock 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_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_set_stock', $product_with_stock );
    		}
    
    

See this hook used in plugins: