woocommerce_order_item_quantity

woocommerce_order_item_quantity

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.3.3

apply_filters('woocommerce_order_item_quantity') is found 2 times:

  • /includes/wc-stock-functions.php line 197
    		 * @param int|float             $quantity Quantity.
    		 * @param WC_Order              $order    Order data.
    		 * @param WC_Order_Item_Product $item Order item data.
    		 */
    		$qty       = apply_filters( 'woocommerce_order_item_quantity', $item->get_quantity(), $order, $item );
    		$item_name = $product->get_formatted_name();
    		$new_stock = wc_update_product_stock( $product, $qty, 'decrease' );
    
    		if ( is_wp_error( $new_stock ) ) {
    			/* translators: %s item name. */
    			$order->add_order_note( sprintf( __( 'Unable to reduce stock for item %s.', 'woocommerce' ), $item_name ) );
    
  • /src/Checkout/Helpers/ReserveStock.php line 126
    				 * @param int|float             $quantity Quantity.
    				 * @param WC_Order              $order    Order data.
    				 * @param WC_Order_Item_Product $item Order item data.
    				 */
    				$item_quantity = apply_filters( 'woocommerce_order_item_quantity', $item->get_quantity(), $order, $item );
    
    				$rows[ $managed_by_id ] = isset( $rows[ $managed_by_id ] ) ? $rows[ $managed_by_id ] + $item_quantity : $item_quantity;
    
    				if ( count( $held_stock_notes ) < 5 ) {
    					// translators: %1$s is a product's formatted name, %2$d: is the quantity of said product to which the stock hold applied.
    					$held_stock_notes&#91;&#93; = sprintf( _x( '- %1$s &times; %2$d', 'held stock note', 'woocommerce' ), $product->get_formatted_name(), $rows[ $managed_by_id ] );