WC_Order::add_order_item_totals_payment_method_row()protectedWC 1.0

Add total row for the payment method.

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_payment_method_row( $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_payment_method_row() code WC 8.7.0

protected function add_order_item_totals_payment_method_row( &$total_rows, $tax_display ) {
	if ( $this->get_total() > 0 && $this->get_payment_method_title() && 'other' !== $this->get_payment_method() ) {
		$total_rows['payment_method'] = array(
			'label' => __( 'Payment method:', 'woocommerce' ),
			'value' => $this->get_payment_method_title(),
		);
	}
}