Check Out
@php
$checkoutStockMessages = array_values(array_unique(array_merge(
$stockIssueMessages ?? [],
session('stock_issues', [])
)));
@endphp
@if(session('error') || count($checkoutStockMessages) || $errors->any())
@endif
@if(session('success'))
Order could not be placed
@if(session('error'))
@endif
@if ($errors->any())
{{ session('error') }}
@endif
@if(count($checkoutStockMessages))
-
@foreach($checkoutStockMessages as $msg)
- {{ $msg }} @endforeach
-
@foreach($errors->all() as $error)
- {{ $error }} @endforeach
Validation Errors
-
@foreach ($errors->all() as $error)
- {{ $error }} @endforeach
{{ session('success') }}
@endif
@if(session('error'))
{!! session('error') !!}
@endif
Customer Details
Order Summary
{{-- Show First 3 Items by Default --}}
{{-- Show More / Show Less Button --}}
@endif
{{-- TOTALS - Always Visible at Bottom --}}
{{--
@foreach($groupedCart->take(3) as $groupKey => $items)
@php
$firstItem = $items->first();
$totalQty = $items->sum('quantity');
$totalPrice = $items->sum(fn($item) => $item->getPriceSum());
@endphp
@endforeach
{{-- Remaining Items (Hidden by Default) --}}
@if($groupedCart->count() > 3)
{{ $firstItem->name }}
{{ $firstItem->attributes->color }}
SAR {{ number_format($totalPrice, 2) }}
@foreach($items as $item)
{{ $item->attributes->size }} × {{ $item->quantity }}
@endforeach
@foreach($groupedCart->skip(3) as $groupKey => $items)
@php
$firstItem = $items->first();
$totalQty = $items->sum('quantity');
$totalPrice = $items->sum(fn($item) => $item->getPriceSum());
@endphp
@endforeach
{{ $firstItem->name }}
{{ $firstItem->attributes->color }}
SAR {{ number_format($totalPrice, 2) }}
@foreach($items as $item)
{{ $item->attributes->size }} × {{ $item->quantity }}
@endforeach
Sub Total
{{ config('constants.currency_symbol') }} {{ number_format($subTotal, 2) }}
@if(($discountAmount ?? 0) > 0)
Discount ({{ rtrim(rtrim(number_format($discountPercent, 2), '0'), '.') }}%)
- {{ config('constants.currency_symbol') }} {{ number_format($discountAmount, 2) }}
@endif
VAT (15%)
{{ config('constants.currency_symbol') }} {{ number_format($vatAmount, 2) }}
Grand Total
{{ config('constants.currency_symbol') }} {{ number_format($grandTotal, 2) }}
Total
SAR {{ number_format($total, 2) }}
--}}