Files
shopPRO/templates/shop-basket/basket-mini.php
Jacek Pyziak 437d4c78dc ver. 0.288: BasketCalculator + ShopBasketController migration, cms\Layout removal
- Migrate front\factory\ShopBasket → Domain\Basket\BasketCalculator (4 static methods, 18 callers updated)
- Migrate front\controls\ShopBasket → front\Controllers\ShopBasketController (camelCase, instance methods)
- Add snake_case→camelCase action dispatch for new controllers in Site::route()
- Update title()/page_title() to check front\Controllers\ before fallback
- Remove cms\Layout class (replaced by $layoutsRepo->find())
- Add 8 tests for BasketCalculator (484 tests, 1528 assertions)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:38:45 +01:00

24 lines
1.0 KiB
PHP

<? global $lang;?>
<div id="basket-mini">
<a href="/koszyk" title="Przejdź do koszyka">
<div class="icon">
<img src="/layout/images/shopping-cart.svg">
</div>
<div class="basket-details">
<div class="title">Twój koszyk</div>
<div class="details">
<b><?= ucfirst( $lang['ilosc'] );?></b>: <span id="products-count"><?= $count = \Domain\Basket\BasketCalculator::countProducts( $this -> basket );?>
<?
switch ( true )
{
case ( $count == 0 ): echo 'produktów'; break;
case ( $count == 1 ): echo 'produkt'; break;
case ( $count == 2 or $count == 3 or $count == 4 ): echo 'produkty'; break;
case ( $count >= 5 ): echo 'produktów'; break;
}
?></span><br />
<b><?= ucfirst( $lang['suma'] );?></b>: <span id="basket-value"><?= \Shared\Helpers\Helpers::decimal( \Domain\Basket\BasketCalculator::summaryPrice( $this -> basket, $this -> coupon ) );?></span> zł
</div>
</div>
</a>
</div>