Skip to content

Commit

Permalink
Show specific information about the payments in order detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
moneimagento committed Dec 11, 2024
1 parent c9fe439 commit 36e0043
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 0 additions & 1 deletion Block/Info/Monei.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
class Monei extends Info
{
private const INFO_PAY_ALLOWED = [
'method',
'last4',
'brand',
'phoneNumber',
Expand Down
15 changes: 14 additions & 1 deletion view/frontend/templates/info/monei.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,28 @@
*/
$paymentTitle = $block->getPaymentTitle();
$paymentInfo = $block->getPaymentInfo();
$infoCard = '';
?>
<?= $block->escapeHtml($paymentTitle) ?>
<?php if (is_array($paymentInfo)) : ?>
<?php foreach ($paymentInfo as $payKey => $payValue): ?>
<?php if (in_array($payKey, $block->getInfoPayAllowed(), true)) : ?>
<?php if($payKey === 'last4') : ?>
<?php $infoCard = $infoCard . '···· '. $payValue; ?>
<?php continue; ?>
<?php endif; ?>
<?php if($payKey === 'brand') : ?>
<?php $infoCard = ucfirst($payValue) . ' '. $infoCard; ?>
<?php continue; ?>
<?php endif; ?>
<div class="admin__page-section-item-content">
<strong><?= $block->escapeHtml(__($payKey . ':')) ?></strong>
<span class="payment_details"><?= $block->escapeHtml($payValue) ?></span>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php if($infoCard) : ?>
<div class="admin__page-section-item-content">
<span class="payment_details"><?= $block->escapeHtml($infoCard) ?></span>
</div>
<?php endif; ?>
<?php endif; ?>

0 comments on commit 36e0043

Please sign in to comment.