woocommerce_prevent_adjust_line_item_product_stock хук-фильтрWC 3.7.1

Prevent adjust line item product stock.

Использование

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.

Список изменений

С версии 3.7.1 Введена.

Где вызывается хук

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

Где используется хук в WooCommerce

Использование не найдено.