WordPress at Your Fingertips
function is not described

WC_Abstract_Order::add_order_item_totals_fee_rows() protected WC 1.0

Add total row for fees.

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

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->add_order_item_totals_fee_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_fee_rows() WC 5.8.0

protected function add_order_item_totals_fee_rows( &$total_rows, $tax_display ) {
	$fees = $this->get_fees();

	if ( $fees ) {
		foreach ( $fees as $id => $fee ) {
			if ( apply_filters( 'woocommerce_get_order_item_totals_excl_free_fees', empty( $fee['line_total'] ) && empty( $fee['line_tax'] ), $id ) ) {
				continue;
			}
			$total_rows[ 'fee_' . $fee->get_id() ] = array(
				'label' => $fee->get_name() . ':',
				'value' => wc_price( 'excl' === $tax_display ? $fee->get_total() : $fee->get_total() + $fee->get_total_tax(), array( 'currency' => $this->get_currency() ) ),
			);
		}
	}
}