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'


Top ↑

Return Return

(int)


Top ↑

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

Top ↑

Changelog Changelog

Changelog
Version Description
2.4.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.