WC_Order::add_order_item_totals_refund_rows( array $total_rows, string $tax_display )

Add total row for refunds.


Description Description


Parameters Parameters

$total_rows

(Required) Total rows.

$tax_display

(Required) Tax to display.


Top ↑

Source Source

File: includes/class-wc-order.php

	protected function add_order_item_totals_refund_rows( &$total_rows, $tax_display ) {
		$refunds = $this->get_refunds();
		if ( $refunds ) {
			foreach ( $refunds as $id => $refund ) {
				$total_rows[ 'refund_' . $id ] = array(
					'label' => $refund->get_reason() ? $refund->get_reason() : __( 'Refund', 'woocommerce' ) . ':',
					'value' => wc_price( '-' . $refund->get_amount(), array( 'currency' => $this->get_currency() ) ),
				);
			}
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

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