@forelse($cartItems as $item)
@php
$hasDiscount = isset($item['price_afterdiscount']) && (int) $item['price_afterdiscount'] > 0 && (int) $item['price_afterdiscount'] < (int) $item['price'];
$price = $hasDiscount ? (int) $item['price_afterdiscount'] : (int) $item['price'];
$qty = (int) ($item['quantity'] ?? 1);
$lineSubtotal = $price * $qty;
@endphp
{{ $item['name'] }}
Rp{{ number_format($lineSubtotal, 0, ',', '.') }}
{{ $qty }}x
@ Rp{{ number_format($price, 0, ',', '.') }}
@if (! empty($packageContentsByProductId[(int) ($item['id'] ?? 0)] ?? []))
Isi Paket
@foreach (($packageContentsByProductId[(int) ($item['id'] ?? 0)] ?? []) as $content)
-
{{ $content }}
@endforeach
@endif
@if(!empty($item['note']))
"{{ $item['note'] }}"
@endif
@empty
Keranjang kosong
@endforelse
@if(($voucherDiscountAmount ?? 0) > 0)
Diskon Voucher
-Rp{{ number_format((int) $voucherDiscountAmount, 0, ",", ".") }}
@endif
@if(($pointDiscountAmount ?? 0) > 0)
Diskon Poin ({{ number_format((int) ($pointsToRedeem ?? 0), 0, ",", ".") }} poin)
-Rp{{ number_format((int) ($pointDiscountAmount ?? 0), 0, ",", ".") }}
@endif
@if($tax > 0)
PB1 ({{ $taxRate }}%)
Rp{{ number_format($tax, 0, ",", ".") }}
@endif
@if($rounding_adjustment != 0)
Pembulatan
Rp{{ number_format($rounding_adjustment, 0, ",", ".") }}
@endif
Biaya Admin (0,7%)
Rp{{ number_format($midtransFee, 0, ",", ".") }}
Total
Rp{{ number_format($total, 0, ",", ".") }}
Rp{{ number_format($totalWithFee, 0, ",", ".") }}