add_filter( 'woocommerce_product_get_stock_quantity' ,'custom_get_stock_quantity', 10, 2 ); add_filter( 'woocommerce_product_variation_get_stock_quantity' ,'custom_get_stock_quantity', 10, 2 ); function custom_get_stock_quantity( $value, $product ) { $value = 15; // <== Just for testing return $value; }