changed order total to net total after refund to be consistent with backend order details ref #7138
This commit is contained in:
parent
980695e7f0
commit
244bd18d6c
|
@ -88,17 +88,29 @@ $order = wc_get_order( $order_id );
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<?php
|
<?php
|
||||||
if ( $totals = $order->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 = '<del>' . strip_tags( $order->get_formatted_order_total() ) . '</del> <ins>' . wc_price( $order->get_total() - $order->get_total_refunded(), array( 'currency' => $order->get_order_currency() ) ) . '</ins>';
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><?php echo $total['label']; ?></th>
|
<th scope="row"><?php echo $total['label']; ?></th>
|
||||||
<td><?php echo $total['value']; ?></td>
|
<td><?php echo $value; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
// check for refund
|
// check for refund
|
||||||
if ( $order->get_total_refunded() !== NULL ) {
|
if ( $has_refund ) {
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><?php _e( 'Refunded:', 'woocommerce' ); ?></th>
|
<th scope="row"><?php _e( 'Refunded:', 'woocommerce' ); ?></th>
|
||||||
|
|
Loading…
Reference in New Issue