woocommerce_prevent_adjust_line_item_product_stock filter-hookWC 3.7.1

Prevent adjust line item product stock.

Usage

add_filter( 'woocommerce_prevent_adjust_line_item_product_stock', 'wp_kama_woocommerce_prevent_adjust_line_item_product_stock_filter', 10, 3 );

/**
 * Function for `woocommerce_prevent_adjust_line_item_product_stock` filter-hook.
 * 
 * @param bool          $prevent       If should prevent.
 * @param WC_Order_Item $item          Item object.
 * @param int           $item_quantity Optional quantity to check against.
 *
 * @return bool
 */
function wp_kama_woocommerce_prevent_adjust_line_item_product_stock_filter( $prevent, $item, $item_quantity ){

	// filter...
	return $prevent;
}
$prevent(true|false)
If should prevent.
$item(WC_Order_Item)
Item object.
$item_quantity(int)
Optional quantity to check against.

Changelog

Since 3.7.1 Introduced.

Where the hook is called

wc_maybe_adjust_line_item_product_stock()
woocommerce_prevent_adjust_line_item_product_stock
woocommerce/includes/admin/wc-admin-functions.php 208
if ( apply_filters( 'woocommerce_prevent_adjust_line_item_product_stock', false, $item, $item_quantity ) ) {

Where the hook is used in WooCommerce

Usage not found.