Fixed "Paid By Customer" data when the orders contains refunds

This commit is contained in:
Claudio Sanches 2020-07-27 20:18:33 -03:00
parent c84f2b987b
commit 4f90307e2e
1 changed files with 8 additions and 1 deletions

View File

@ -216,7 +216,14 @@ if ( wc_tax_enabled() ) {
<td class="label"><?php esc_html_e( 'Paid By Customer', 'woocommerce' ); ?>:</td>
<td width="1%"></td>
<td class="total">
<?php echo wc_price( $order->get_total(), array( 'currency' => $order->get_currency() ) ); // WPCS: XSS ok. ?>
<?php
$total_paid_by_customer = $order->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
?>
</td>
</tr>
</table>