@include('flash::message')
@if ($errors->any())
@endif
@php
$vat = 0;
$rate = 0.10;
$subtotal = 0;
@endphp
@isset($cart)
-
@foreach ($errors->all() as $error)
- {{ $error }} @endforeach
@if(count($cart) > 0)
@foreach ($cart as $item)
@php
$product = $item?->product;
$cost = $item->quantity * $product->price;
$subtotal += $cost;
$vat += $cost * $rate;
@endphp
@endif
@endisset
@php
$img = $product->img ?? '';
if ($img) {
if (strpos($img, 'http') === 0) {
$imgUrl = $img;
} elseif (strpos($img, 'storage/') === 0) {
$imgUrl = asset($img);
} else {
$imgUrl = asset('storage/' . $img);
}
} else {
$imgUrl = asset('front/assets/images/emptyproducts.png');
}
@endphp
@endforeach
@else
{{ __('products.empty_cart') }}
{{ __('products.payment_details') }}
{{ __('products.subtotal') }}{{ $subtotal }} SAR
{{ __('products.vat') }}{{ $vat }} SAR
{{ __('products.net_total') }}{{ $subtotal + $vat }} SAR
{{ __('products.proceed_to_payment') }}