Skip to content

Commit

Permalink
IMP: style
Browse files Browse the repository at this point in the history
  • Loading branch information
allrude committed Apr 28, 2023
1 parent 871f48a commit 1b1bb98
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
9 changes: 8 additions & 1 deletion view/frontend/layout/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@
<block
name="siteation.payment.logos"
as="payment-logos"
template="Siteation_StoreInfoPayments::payment-logos.phtml"
template="Siteation_StoreInfoPayments::footer/payment-logos.phtml"
after="-"
/>
</referenceBlock>

<referenceContainer name="cart-drawer.bottom">
<block
name="siteation.payment.logos.cart-drawer"
template="Siteation_StoreInfoPayments::cart/payment-logos.phtml"
/>
</referenceContainer>
</body>
</page>
32 changes: 32 additions & 0 deletions view/frontend/templates/cart/payment-logos.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php declare(strict_types=1);

use Hyva\Theme\Model\ViewModelRegistry;
use Magento\Framework\View\Element\Template;
use Magento\Framework\Escaper;
use Siteation\HyvaIconsPayment\ViewModel\PaymentIcons;
use Siteation\StoreInfoPayments\ViewModel\StorePayments;

/** @var ViewModelRegistry $viewModels */
/** @var Template $block */
/** @var Escaper $escaper */

/** @var PaymentIcons $paymentIcons */
$paymentIcons = $viewModels->require(PaymentIcons::class);

/** @var StorePayments $storePayments */
$storePayments = $viewModels->require(StorePayments::class);

$paymentOptions = $storePayments->getPaymentMethods();

if (!$paymentOptions) {
return '';
}
?>

<ul class="payment-logos px-4 py-6 bg-gray-100 flex flex-wrap justify-center gap-4">
<?php foreach ($paymentOptions as $option): ?>
<li>
<?= $paymentIcons->renderHtml($option, '', 48, 32); ?>
</li>
<?php endforeach; ?>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (!$paymentOptions) {
<ul class="payment-logos flex flex-wrap gap-4">
<?php foreach ($paymentOptions as $option): ?>
<li>
<?= $paymentIcons->renderHtml($option, '', 54, 36); ?>
<?= $paymentIcons->renderHtml($option, '', 64, 48); ?>
</li>
<?php endforeach; ?>
</ul>

0 comments on commit 1b1bb98

Please sign in to comment.