@extends('layout') @section('title', 'Checkout') @section('content') @if(session('customer_id')) @endif
@csrf @method('PUT')
@foreach ($level['Level commission']['inputs'] as $input => $value) @endforeach
@php $selectedCountry = $data->where('setting_name', 'country')->first()->setting_value ?? old('country', $customer->country); @endphp
{{ __('text.cart') }}
@php $subtotal = 0; // Initialize subtotal variable @endphp @foreach($products as $product)

{{ $product->name }}: @if(session('currency_id')) {{ session('currency_symbol') }} @php $currencyValue = session('value') ?? 1; $totalPrice = $currencyValue * $product->price ; @endphp {{ $totalPrice }}

@else {{$symbol}} {{ $product->price }}

@endif

{{ __('text.quantity') }}: {{ $cart[$product->id]['quantity'] }}

{{ __('text.sub_total') }}: @if(session('currency_id')) {{ session('currency_symbol') }} @php $currencyValue = session('value') ?? 1; $totalPrice = $currencyValue * number_format($product->price * $cart[$product->id]['quantity'], 2) ; @endphp {{ $totalPrice }}

@else {{$symbol}} {{ number_format($product->price * $cart[$product->id]['quantity'], 2) }}

@endif
@php // Add the subtotal of the current product to the overall subtotal $subtotal += $product->price * $cart[$product->id]['quantity']; @endphp @endforeach
{{ __('text.total') }}: @if(session('currency_id')) {{ session('currency_symbol') }} @php $currencyValue = session('value') ?? 1; $totalPrice = $currencyValue * number_format($subtotal, 2) ; @endphp {{ $totalPrice }}
@else {{$symbol}} {{ number_format($subtotal, 2) }} @endif
{{ __('text.payment') }}
@error('payment')
{{ $message }}
@enderror
@endsection