We are using Woocommerce Payments and on our order confirmation email the payment method comes up as Woocommerce Payments instead of the payment source such as Visa, Mastercard etc.
I have found how to remove the Payment method altogether (see below), but how would I remove this and add back in Payment Source?
<tfoot>
<?php
if ( $totals = $order->get_order_item_totals() ) {
$i = 0;
foreach ( $totals as $key => $total ) {
$i++;
if ( $key !== 'payment_method' ){
?><tr>
<th scope="row" colspan="2" style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
</tr><?php
}
}
}
?>
2
Answers
In your functions.php add this
It seems that the order field
_payment_method_title
is used in emails, while'_payment_method
is the one displayed in the admin panel. So one option would be to update this field:You could do this in an action when the order is created or marked paid.