WC_Order::get_total_tax_refunded_by_rate_id( int $rate_id )

Get total tax refunded by rate ID.


Description Description


Parameters Parameters

$rate_id

(Required) Rate ID.


Top ↑

Return Return

(float)


Top ↑

Source Source

File: includes/class-wc-order.php

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


Top ↑

User Contributed Notes User Contributed Notes

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