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', 'filter_function_name_170', 10, 3 ); function filter_function_name_170( $prevent, $item, $item_quantity ){ // filter... return $prevent; }
- $prevent(true/false)
- If should prevent.
- $item(WC_Order_Item)
- Item object.
- $item_quantity(число)
- Optional quantity to check against.
Список изменений
С версии 3.7.1 | Введена. |
Где вызывается хук
woocommerce_prevent_adjust_line_item_product_stock
woocommerce/includes/admin/wc-admin-functions.php 205
if ( apply_filters( 'woocommerce_prevent_adjust_line_item_product_stock', false, $item, $item_quantity ) ) {