@php $items = collect($getState() ?? []); $active = $items->where('saved_for_later', false)->values(); $saved = $items->where('saved_for_later', true)->values(); @endphp

Active Cart

@if($active->isEmpty() && $saved->isEmpty())
No active cart
@else @if($active->isNotEmpty())

{{ $active->count() }} item{{ $active->count() !== 1 ? 's' : '' }} in cart

@foreach($active->take(5) as $item)
{{ $item->product_name ?? $item->turn14_product_id ?? 'Unknown product' }} × {{ $item->qty }} @if($item->unit_price_incl)  R {{ number_format($item->unit_price_incl, 2) }} @endif
@endforeach @if($active->count() > 5)

+{{ $active->count() - 5 }} more item{{ $active->count() - 5 !== 1 ? 's' : '' }}

@endif
@endif @if($saved->isNotEmpty())

{{ $saved->count() }} saved for later

@endif @endif