@extends('frontend.layout.template') @section('content') @php $buyer = session()->get('buyer'); @endphp
@if(!empty($cart))
@csrf

CHECKOUT

@if(!empty($buyer))
@else
@endif
or Cancel

Order summary

@php $discount=0; $tax=0; $subtotal=0; $total=0; @endphp @foreach($cart as $key=>$item) @php $discount=$discount+$item['discount']; $tax=$tax+$item['tax']; $subtotal=$subtotal+($item['price']*$item['quantity']); $total=$total+$item['total']; @endphp @endforeach

{{$item['name']}}

@if(!empty($item['attribute'])) @endif
{{$item['quantity']}} x ₹{{$item['price']}}
@php $coupon = session()->get('coupon'); @endphp @if(!empty($coupon)) @php if($coupon['discount_type']=='%') { $total=$total-($total*($coupon['discount_value']/100)); }elseif($coupon['discount_type']=='₹'){ $total=$total-$coupon['discount_value']; } @endphp @endif
TAX %{{$tax}}
SUBTOTAL ₹{{$subtotal}}
DISCOUNT {{$coupon['discount_type']}}{{$coupon['discount_value']}} x
GRAND TOTAL ₹{{$total}}
@if(empty($coupon))
@endif
@else

SHOPPING CART IS EMPTY

You have no items in your shopping cart.

CONTINUE SHOPPING
@endif
@endsection