From 4f90307e2ebda287b32a9eb4830430bd2d341801 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Mon, 27 Jul 2020 20:18:33 -0300 Subject: [PATCH] Fixed "Paid By Customer" data when the orders contains refunds --- includes/admin/meta-boxes/views/html-order-items.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/admin/meta-boxes/views/html-order-items.php b/includes/admin/meta-boxes/views/html-order-items.php index 2981b467db4..554eca52ef9 100644 --- a/includes/admin/meta-boxes/views/html-order-items.php +++ b/includes/admin/meta-boxes/views/html-order-items.php @@ -216,7 +216,14 @@ if ( wc_tax_enabled() ) { : - get_total(), array( 'currency' => $order->get_currency() ) ); // WPCS: XSS ok. ?> + get_total(); + if ( $order->get_total_refunded() ) { + $total_paid_by_customer -= $order->get_total_refunded(); + } + + echo wc_price( $total_paid_by_customer, array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + ?>