Add last 4 digits & card type of PDF invoices
-
Hello
I am using this code from another of your forums but it’s not working on my site
add_action( ‘wpo_wcpdf_after_order_data’, ‘wpo_wcpdf_cc_last_four’, 10, 2 );
function wpo_wcpdf_cc_last_four ($template_type, $order) {
if ($template_type == ‘invoice’) {
$digits = $order->get_meta(‘_wc_square_credit_card_account_four’);
$card_type = $order->get_meta(‘_wc_square_credit_card_card_type’);
if (!empty($digits)) {
?>
<tr class=”cc-four-digits”>
<th>Last Four Digits:</th>
<td><?php echo $digits; ?></td>
</tr>
<?php
}
if (!empty($card_type)) {
?>
<tr class=”cc-type”>
<th>Credit card:</th>
<td><?php echo $card_type; ?></td>
</tr>
<?php
}
}
}Please advise!
- The topic ‘Add last 4 digits & card type of PDF invoices’ is closed to new replies.