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:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user