WordPress at Your Fingertips
function is not described

WC_Order::get_total_qty_refunded() public WC 2.4.0

Get the total number of items refunded.

{} It's a method of the class: WC_Order{}

No Hooks.

Return

Int.

Usage

$WC_Order = new WC_Order();
$WC_Order->get_total_qty_refunded( $item_type );
$item_type(string)
Type of the item we're checking, if not a line_item.
Default: 'line_item'

Changelog

Since 2.4.0 Introduced.

Code of WC_Order::get_total_qty_refunded() WC 5.8.0

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;
}