This commit is contained in:
2026-03-28 11:33:56 +01:00
parent 412e235512
commit aa8e21862d
132 changed files with 24381 additions and 10882 deletions

View File

@@ -13,7 +13,14 @@
$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 ):?>
<?
$min = isset($payment_method['min_order_amount']) ? (float)$payment_method['min_order_amount'] : null;
$max = isset($payment_method['max_order_amount']) ? (float)$payment_method['max_order_amount'] : null;
$show = true;
if ($min !== null && $min > 0 && $basket_summary < $min) $show = false;
if ($max !== null && $max > 0 && $basket_summary > $max) $show = false;
?>
<? if ( $show ):?>
<div class="options">
<div class="check">
<input type="radio" class="icheck" name="payment_method" value="<?= $payment_method['id'];?>"

View File

@@ -52,6 +52,32 @@ if ( is_array( $this -> transports_methods ) )
</div>
<? endif;?>
<? endforeach; endif;?>
<?php if ( $this->free_delivery > 0 ): ?>
<?php
$percentage = min(100, ($this->basket_summary / $this->free_delivery) * 100);
$remaining = $this->free_delivery - $this->basket_summary;
?>
<div class="free-delivery-bar <?= $percentage >= 100 ? 'success' : '' ?>">
<div class="free-delivery-bar__icon">&#x1F69A;</div>
<div class="free-delivery-bar__content">
<?php if ($percentage >= 100): ?>
<div class="free-delivery-bar__text">Gratulacje! Masz darmow&#261; dostaw&#281;!</div>
<?php else: ?>
<div class="free-delivery-bar__text">
Zr&#243;b zakupy za <?= \Shared\Helpers\Helpers::decimal( $this->free_delivery, 2 );?> z&#322; i otrzymaj darmow&#261; dostaw&#281;
</div>
<?php endif; ?>
<div class="free-delivery-bar__progress">
<div class="free-delivery-bar__progress-fill" style="width: <?= $percentage ?>%"></div>
</div>
<?php if ($percentage < 100): ?>
<div class="free-delivery-bar__remaining">
Brakuje <strong><?= \Shared\Helpers\Helpers::decimal( $remaining, 2 );?> z&#322;</strong> do darmowej dostawy.
</div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<script class="footer" type="text/javascript">
$( function() {

View File

@@ -179,7 +179,7 @@
'id': <?= (int)$product['product_id'];?>,
'name': '<?= $product['name'];?>',
'quantity': <?= $product['quantity'];?>,
'price': <?= $product['price_brutto_promo'];?>
'price': <?= ((float)$product['price_brutto_promo'] > 0 && (float)$product['price_brutto_promo'] < (float)$product['price_brutto']) ? (float)$product['price_brutto_promo'] : (float)$product['price_brutto'];?>
}<? if ( $product != end( $this -> order['products'] ) ) echo ',';?>
<? endforeach;?>
]