Fix empty last4 rendering (#52399)

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
This commit is contained in:
Alba Rincón 2024-10-30 17:13:16 +01:00 committed by GitHub
parent e35c326b8c
commit 5078b45da2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
Avoid rendering the dash in the receipts when there's no info about the card used to pay the order.

View File

@ -26,7 +26,10 @@
<h3 id="payment_method_section_title"><?php echo strtoupper( $data['texts']['payment_method_section_title'] ); ?></h3>
<p>
<?php if ( $data['payment_info'] ) { ?>
<span class="card-icon"></span> - <?php echo $data['payment_info']['card_last4']; ?>
<span class="card-icon"></span>
<?php if ( $data['payment_info']['card_last4'] ) { ?>
- <?php echo $data['payment_info']['card_last4']; ?>
<?php } ?>
<?php } else { ?>
<span><?php echo $data['payment_method']; ?></span>
<?php } ?>