Files
marianek.pl/templates/shop-basket/basket-payments-methods.php
Jacek Pyziak fc45bbf20e Add view classes for articles, banners, languages, menu, newsletter, containers, shop categories, clients, payment methods, products, and search
- Created `Articles` class for rendering article views including full articles, miniature lists, and news sections.
- Added `Banners` class for handling banner displays.
- Introduced `Languages` class for rendering language options.
- Implemented `Menu` class for rendering page and menu structures.
- Developed `Newsletter` class for newsletter rendering.
- Created `Scontainers` class for rendering specific containers.
- Added `ShopCategory` class for managing shop category views and pagination.
- Implemented `ShopClient` class for client-related views including address management and login forms.
- Created `ShopPaymentMethod` class for displaying payment methods in the basket.
- Added `ShopProduct` class for generating product URLs.
- Introduced `ShopSearch` class for rendering a simple search form.
- Added `.htaccess` file in the plugins directory to enhance security by restricting access to sensitive files and directories.
2026-02-21 23:00:54 +01:00

45 lines
2.1 KiB
PHP

<?
$pm_found = false;
if ( is_array( $this -> payment_methods ) ): foreach ( $this -> payment_methods as $payment_method ):
if ( $payment_method['id'] == \Shared\Helpers\Helpers::get_session( 'basket-payment-method-id' ) )
$pm_found = true;
endforeach; endif;
$basket = \Shared\Helpers\Helpers::get_session( 'basket' );
$coupon = \Shared\Helpers\Helpers::get_session( 'coupon' );
$transport_cost = ( new \Domain\Transport\TransportRepository( $GLOBALS['mdb'] ) )->transportCostCached( (int)\Shared\Helpers\Helpers::get_session( 'basket-transport-method-id' ) ) ?? 0.0;
$basket_summary = \Domain\Basket\BasketCalculator::summaryPrice( $basket, $coupon ) + $transport_cost;
?>
<? if ( is_array( $this -> payment_methods ) ): foreach ( $this -> payment_methods as $payment_method ):?>
<? if ( $payment_method['id'] != 6 or $payment_method['id'] == 6 and $basket_summary >= 40 and $basket_summary <= 1000 ):?>
<div class="options">
<div class="check">
<input type="radio" class="icheck" name="payment_method" value="<?= $payment_method['id'];?>"
<?
if (
$payment_method['id'] == \Shared\Helpers\Helpers::get_session( 'basket-payment-method-id' )
or
count( $this -> payment_methods ) === 1
or
!\Shared\Helpers\Helpers::get_session( 'basket-payment-method-id' ) and $payment_method == end( $this -> payment_methods )
or
\Shared\Helpers\Helpers::get_session( 'basket-payment-method-id' ) and !$pm_found and $payment_method == end( $this -> payment_methods )
):
\Shared\Helpers\Helpers::set_session( 'basket-payment-method-id', $payment_method['id'] );
echo 'checked="checked"';
endif;
?>
>
</div>
<div class="description">
<div><?= $payment_method['name'];?> <? if ( $payment_method['id'] == 6 ):?><img src="/layout/images/paypo-logo.svg"><? endif;?></div>
<div class="small"><?= $payment_method['description'];?></div>
</div>
</div>
<? endif;?>
<? endforeach; endif;?>