woocommerce_order_item_quantity хук-фильтрWC 1.0

Filter order item quantity.

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

add_filter( 'woocommerce_order_item_quantity', 'wp_kama_woocommerce_order_item_quantity_filter', 10, 3 );

/**
 * Function for `woocommerce_order_item_quantity` filter-hook.
 * 
 * @param int|float             $quantity Quantity.
 * @param WC_Order              $order    Order data.
 * @param WC_Order_Item_Product $item     Order item data.
 *
 * @return int|float
 */
function wp_kama_woocommerce_order_item_quantity_filter( $quantity, $order, $item ){

	// filter...
	return $quantity;
}
$quantity(int|float)
Quantity.
$order(WC_Order)
Order data.
$item(WC_Order_Item_Product)
Order item data.

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

ReserveStock::reserve_stock_for_order()
woocommerce_order_item_quantity
wc_reduce_stock_levels()
woocommerce_order_item_quantity
woocommerce/src/Checkout/Helpers/ReserveStock.php 111
$item_quantity = apply_filters( 'woocommerce_order_item_quantity', $item->get_quantity(), $order, $item );
woocommerce/includes/wc-stock-functions.php 187
$qty       = apply_filters( 'woocommerce_order_item_quantity', $item->get_quantity(), $order, $item );

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

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