WC_Order::get_total_qty_refunded PHP Method

get_total_qty_refunded() public method

Get the total number of items refunded.
Since: 2.4.0
public get_total_qty_refunded ( string $item_type = 'line_item' ) : integer
$item_type string type of the item we're checking, if not a line_item
return integer
    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;
    }
WC_Order