WC_Order::get_total_qty_refunded( string $item_type = 'line_item' )
Get the total number of items refunded.
Description Description
Parameters Parameters
- $item_type
-
(Optional) Type of the item we're checking, if not a line_item.
Default value: 'line_item'
Return Return
(int)
Source Source
File: includes/class-wc-order.php
public function get_total_qty_refunded( $item_type = 'line_item' ) { $qty = 0; foreach ( $this->get_refunds() as $refund ) { foreach ( $refund->get_items( $item_type ) as $refunded_item ) { $qty += $refunded_item->get_quantity(); } } return $qty; }
Changelog Changelog
Version | Description |
---|---|
2.4.0 | Introduced. |