@extends('frontend.master') @section('page-content')

Check Out

@php $checkoutStockMessages = array_values(array_unique(array_merge( $stockIssueMessages ?? [], session('stock_issues', []) ))); @endphp @if(session('error') || count($checkoutStockMessages) || $errors->any()) @endif @if ($errors->any()) @endif @if(session('success')) @endif @if(session('error')) @endif

Customer Details

@csrf
@include('partials.delivery-option-field')
@if($allowCredit)
@endif

Order Summary

{{-- Show First 3 Items by Default --}}
@foreach($groupedCart->take(3) as $groupKey => $items) @php $firstItem = $items->first(); $totalQty = $items->sum('quantity'); $totalPrice = $items->sum(fn($item) => $item->getPriceSum()); @endphp
{{ $firstItem->name }}
{{ $firstItem->attributes->color }}
SAR {{ number_format($totalPrice, 2) }}
@foreach($items as $item) {{ $item->attributes->size }} × {{ $item->quantity }} @endforeach
@endforeach
{{-- Remaining Items (Hidden by Default) --}} @if($groupedCart->count() > 3)
@foreach($groupedCart->skip(3) as $groupKey => $items) @php $firstItem = $items->first(); $totalQty = $items->sum('quantity'); $totalPrice = $items->sum(fn($item) => $item->getPriceSum()); @endphp
{{ $firstItem->name }}
{{ $firstItem->attributes->color }}
SAR {{ number_format($totalPrice, 2) }}
@foreach($items as $item) {{ $item->attributes->size }} × {{ $item->quantity }} @endforeach
@endforeach
{{-- Show More / Show Less Button --}} @endif {{-- TOTALS - Always Visible at Bottom --}}
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) }}
--}}
@endsection @push('js-script') @endpush @push('js-script') @endpush @push('css-style') @endpush @push('js-script') @endpush