WordPress at Your Fingertips
function is not described

WC_Order::get_total_tax_refunded_by_rate_id() public WC 1.0

Get total tax refunded by rate ID.

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

No Hooks.

Return

float.

Usage

$WC_Order = new WC_Order();
$WC_Order->get_total_tax_refunded_by_rate_id( $rate_id );
$rate_id(int) (required)
Rate ID.

Code of WC_Order::get_total_tax_refunded_by_rate_id() WC 5.7.1

public function get_total_tax_refunded_by_rate_id( $rate_id ) {
	$total = 0;
	foreach ( $this->get_refunds() as $refund ) {
		foreach ( $refund->get_items( 'tax' ) as $refunded_item ) {
			if ( absint( $refunded_item->get_rate_id() ) === $rate_id ) {
				$total += abs( $refunded_item->get_tax_total() ) + abs( $refunded_item->get_shipping_tax_total() );
			}
		}
	}

	return $total;
}