WC_Order::add_order_item_totals_refund_rows()
Add total row for refunds.
Method of the class: WC_Order{}
No Hooks.
Return
null
. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->add_order_item_totals_refund_rows( $total_rows, $tax_display );
- $total_rows(array) (required) (passed by reference — &)
- Total rows.
- $tax_display(string) (required)
- Tax to display.
WC_Order::add_order_item_totals_refund_rows() WC Order::add order item totals refund rows code WC 8.7.0
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() ) ), ); } } }