fix: poprawny koszt transportu na /koszyk-podsumowanie

Na podstronie /koszyk-podsumowanie transport z flaga delivery_free=1
byl pokazywany zawsze za 0,00 zl, niezaleznie od wartosci koszyka.
Teraz kontroler wylicza transport_cost_effective i free_delivery_applies
uwzgledniajac prog settings.free_delivery, a szablon uzywa tych kluczy.

- Nowa chroniona metoda ShopBasketController::calculateTransportCostForSummary
- Dodane 6 testow jednostkowych (ShopBasketControllerSummaryViewTest)
- Suita: 834 testy / 2318 assertions OK

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jacek
2026-04-20 20:50:15 +02:00
parent 494cb580d3
commit eee22ef1c4
11 changed files with 577 additions and 21 deletions

View File

@@ -97,11 +97,11 @@
<div class="basket-summary">
<?= $this -> transport[ 'name_visible' ];?>:
<? if ( $this -> transport[ 'delivery_free' ] == 1 ):?>
<? if ( $this -> free_delivery_applies ):?>
<span>0,00 zł</span>
<? else:?>
<span>
<?= \Shared\Helpers\Helpers::decimal( $this -> transport[ 'cost' ] );?> zł
<?= \Shared\Helpers\Helpers::decimal( $this -> transport_cost_effective );?> zł
</span>
<? endif;?>
</div>
@@ -111,7 +111,7 @@
$summary -= $discount;
?>
<span id="order-summary">
<?= $this -> transport[ 'delivery_free' ] == 1 ? \Shared\Helpers\Helpers::decimal( $summary ) : \Shared\Helpers\Helpers::decimal( $summary + $this -> transport[ 'cost' ] );?> zł
<?= $this -> free_delivery_applies ? \Shared\Helpers\Helpers::decimal( $summary ) : \Shared\Helpers\Helpers::decimal( $summary + $this -> transport_cost_effective );?> zł
</span>
</div>
<div class="basket-summary">