WordPress at Your Fingertips
function is not described

WC_Abstract_Order::add_order_item_totals_tax_rows() protected WC 1.0

Add total row for taxes.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->add_order_item_totals_tax_rows( $total_rows, $tax_display );
$total_rows(array) (required) (passed by reference — &)
Reference to total rows array.
$tax_display(string) (required)
Excl or incl tax display mode.

Code of WC_Abstract_Order::add_order_item_totals_tax_rows() WC 5.8.0

protected function add_order_item_totals_tax_rows( &$total_rows, $tax_display ) {
	// Tax for tax exclusive prices.
	if ( 'excl' === $tax_display && wc_tax_enabled() ) {
		if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) {
			foreach ( $this->get_tax_totals() as $code => $tax ) {
				$total_rows[ sanitize_title( $code ) ] = array(
					'label' => $tax->label . ':',
					'value' => $tax->formatted_amount,
				);
			}
		} else {
			$total_rows['tax'] = array(
				'label' => WC()->countries->tax_or_vat() . ':',
				'value' => wc_price( $this->get_total_tax(), array( 'currency' => $this->get_currency() ) ),
			);
		}
	}
}