WC_Order::add_order_item_totals_refund_rows() protected WC 1.0
Add total row for refunds.
{} It's a method of the class: WC_Order{}
No Hooks.
Return
Null. Nothing.
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)
- Total rows.
- $tax_display(string) (required)
- Tax to display.
Code of WC_Order::add_order_item_totals_refund_rows() WC Order::add order item totals refund rows WC 5.0.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() ) ),
);
}
}
}