From 244bd18d6c9d7a86de7322805d4dee493be1df13 Mon Sep 17 00:00:00 2001 From: splashingpixels Date: Sat, 17 Jan 2015 19:13:24 -0800 Subject: [PATCH] changed order total to net total after refund to be consistent with backend order details ref #7138 --- templates/order/order-details.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/templates/order/order-details.php b/templates/order/order-details.php index bdabfd7cb26..bd119db70db 100644 --- a/templates/order/order-details.php +++ b/templates/order/order-details.php @@ -88,17 +88,29 @@ $order = wc_get_order( $order_id ); get_order_item_totals() ) foreach ( $totals as $total ) : + $has_refund = false; + + if ( $order->get_total_refunded() !== NULL ) { + $has_refund = true; + } + + if ( $totals = $order->get_order_item_totals() ) foreach ( $totals as $key => $total ) : + $value = $total['value']; + + // check for refund + if ( $has_refund && $key === 'order_total' ) { + $value = '' . strip_tags( $order->get_formatted_order_total() ) . ' ' . wc_price( $order->get_total() - $order->get_total_refunded(), array( 'currency' => $order->get_order_currency() ) ) . ''; + } ?> - + get_total_refunded() !== NULL ) { + if ( $has_refund ) { ?>