woocommerce_product_set_stock_status

woocommerce_product_set_stock_status

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

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

do_action('woocommerce_product_set_stock_status') is found 1 times:

  • /includes/data-stores/class-wc-product-data-store-cpt.php line 681
    		if ( in_array( 'stock_status', $this->updated_props, true ) ) {
    			if ( $product->is_type( 'variation' ) ) {
    				do_action( 'woocommerce_variation_set_stock_status', $product->get_id(), $product->get_stock_status(), $product );
    			} else {
    				do_action( 'woocommerce_product_set_stock_status', $product->get_id(), $product->get_stock_status(), $product );
    			}
    		}
    
    		if ( array_intersect( $this->updated_props, array( 'sku', 'regular_price', 'sale_price', 'date_on_sale_from', 'date_on_sale_to', 'total_sales', 'average_rating', 'stock_quantity', 'stock_status', 'manage_stock', 'downloadable', 'virtual', 'tax_status', 'tax_class' ) ) ) {
    			$this->update_lookup_table( $product->get_id(), 'wc_product_meta_lookup' );
    		}
    

See this hook used in plugins: