woocommerce_product_before_set_stock

woocommerce_product_before_set_stock

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

do_action('woocommerce_product_before_set_stock') is found 2 times:

  • /includes/data-stores/class-wc-product-data-store-cpt.php line 728
    						* @since 4.9
    						*
    						* @param int $product The product whose stock is about to change.
    						*/
    						do_action( 'woocommerce_product_before_set_stock', $product );
    					}
    					break;
    			}
    
    			$updated = $this->update_or_delete_post_meta( $product, $meta_key, $value );
    
    
  • /includes/wc-stock-functions.php line 51
    			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 );
    		}
    
    		// Update the database.
    		$new_stock = $data_store->update_product_stock( $product_id_with_stock, $stock_quantity, $operation );
    
    		// Update the product object.