<?php $base = max(0, $totals['subtotal'] - $totals['discount']) + $totals['shipping'] ?>
<dl class="mt-6 space-y-3 text-sm">
<div class="flex justify-between text-zinc-600">
<dt>Ara toplam</dt>
<dd class="font-medium text-ink"><?= money($totals['subtotal']) ?></dd>
</div>
<?php if ($totals['discount'] > 0): ?>
<div class="flex justify-between text-emerald-700">
<dt>İndirim</dt>
<dd class="font-medium">−<?= money($totals['discount']) ?></dd>
</div>
<?php endif ?>
<div class="flex justify-between text-zinc-600">
<dt>Kargo</dt>
<dd class="font-medium text-ink"><?= $totals['shipping'] > 0 ? money($totals['shipping']) : 'Ücretsiz' ?></dd>
</div>
<?php if (isset($fee)): ?>
<div data-fee-row class="<?= $fee > 0 ? 'flex' : 'hidden' ?> justify-between text-zinc-600">
<dt>Kapıda ödeme ücreti</dt>
<dd data-fee-amount class="font-medium text-ink"><?= money($fee) ?></dd>
</div>
<?php endif ?>
<div class="flex items-baseline justify-between border-t border-zinc-200 pt-4">
<dt class="font-semibold text-ink">Toplam</dt>
<dd data-grand-total data-base="<?= $base ?>" class="font-display text-2xl font-semibold tracking-tight text-ink"><?= money($base + ($fee ?? 0)) ?></dd>
</div>
<?php if (!empty($totals['tax'])): ?>
<p class="text-right text-xs text-zinc-500">KDV (%<?= (float) tax_rate() ?>) dahil: <?= money($totals['tax']) ?></p>
<?php endif ?>
</dl>
Lisans bilgisi projenin LICENSE dosyasında.