@extends('frontend.layouts.frontend_app') @push('style') @endpush @section('content')
@csrf
{{__('pages.Delivery Address')}}
{{__('pages.Add New Address')}}

@forelse($addresses as $address)
id) checked @endif type="radio" id="address{{$address->id}}" value="{{$address->id}}" name="delivery_address_id" class="custom-control-input">
@empty
{{__('pages.Address not available')}}!
@endforelse
@error('delivery_address_id') {{ $message }} @enderror
{{__('pages.Payment Method')}}

@error('payment_method') {{ $message }} @enderror
{{__('pages.Delivery Method')}}

@error('delivery_method') {{ $message }} @enderror
@php $sub_total = 0; $total_discount = 0; $total_amount = 0; $delivery_fee = request('fees') ? request('fees') : 0; @endphp

{{__('pages.Your Order')}}

( @if(session('front_cart')) {{ count(session('front_cart')) }} @else 0 @endif {{__('pages.items in your cart')}} )
@if (session()->has('front_cart')) @if(count(session('front_cart')) > 0) @foreach(session('front_cart') as $cart) @php $discount_price = !empty($cart['discount']) ? $cart['discount'] : 0; $discount = $cart['price']* $discount_price / 100; $total_discount += $discount*$cart['quantity']; $sub_total += $cart['price']*$cart['quantity']; $total_amount = ($sub_total - $total_discount) + $delivery_fee; @endphp @endforeach @else @endif @endif
{{__('pages.Medicine')}} {{__('pages.Price')}} {{__('pages.Quantity')}} {{__('pages.Total Amount')}}
{{ $cart['name'] }} {{ number_format($cart['price'], 2) }}
{{ number_format($cart['price']*$cart['quantity'],2) }}

{{__('pages.Your Cart is empty')}}!

{{__('pages.Go to buy')}}

@if (session()->has('front_cart')) @if(count(session('front_cart')) > 0)
{{__('pages.Sub Total')}} {{ number_format($sub_total,2) }}
{{__('pages.Delivery Fee')}} {{ number_format($delivery_fee,2) }}
{{__('pages.Discount')}} {{ number_format($total_discount,2) }}

{{__('pages.Total Price')}} {{ number_format($total_amount,2) }}

@endif @endif
@if ($total_amount > setting('minimum_order_amount')) @else
{{__('pages.Minimum order amount is')}} {{setting('minimum_order_amount')}}
@endif
@endsection @push('script') @endpush