@php
$summaryStep = $checkoutStep ?? request('step', 'cart');
if (! in_array($summaryStep, ['cart', 'account', 'payment'], true)) {
$summaryStep = 'cart';
}
$subtotal = (float) $cart->items->sum('total');
$discount = min(max((float) $cart->discount, 0), $subtotal);
$totalDue = max(0, $subtotal - $discount);
@endphp
Order Summary
@forelse ($cart->items as $item)
@php
$isDomain = str_starts_with((string) $item->item_type, 'domain_');
$domainDescription = match ($item->item_type) {
'domain_register' => 'Domain registration'.($item->years ? ' - '.$item->years.' year'.((int) $item->years === 1 ? '' : 's') : ''),
'domain_transfer' => 'Domain transfer'.($item->years ? ' - '.$item->years.' year'.((int) $item->years === 1 ? '' : 's') : ''),
'domain_existing' => 'Existing domain',
default => null,
};
@endphp
{{ $isDomain && $item->domain_name ? $item->domain_name : $item->name }}
@if ($isDomain)
{{ $domainDescription }}
@elseif ($item->billing_cycle)
{{ $pricing->cycleLabel($item->billing_cycle) }}
@endif
{{ $pricing->formatMoney($item->total, $item->currency) }}
@empty
No products selected yet.
@endforelse
@if (! $cart->items->isEmpty())
@endif
Subtotal{{ $pricing->formatMoney($subtotal, $cart->currency) }}
@if ($discount > 0)
Discount-{{ $pricing->formatMoney($discount, $cart->currency) }}
@endif
Taxes{{ $pricing->formatMoney(0, $cart->currency) }}
Total{{ $pricing->formatMoney($totalDue, $cart->currency) }}
@if ($summaryStep === 'cart')
@if ($cart->items->isEmpty())
@else
Continue
@endif
@elseif ($summaryStep === 'account')
@else
@endif