@extends('layouts.frontend') @section('content')

Shopping Cart @php if(isset($cart)){ echo count($cart); }else{ echo '0'; } @endphp Items

@if ($message = Session::get('success'))
{{ $message }}
@endif @if ($message = Session::get('error'))
{{ $message }}
@endif
@if(isset($cart))
@csrf @if(isset($cart)) @php $total_quantity = 0; $subTotal = 0; @endphp @foreach($cart as $key => $value) @php $total_quantity = $total_quantity+$value['quantity']; $subTotal = $subTotal+($value['price']*$value['quantity']); @endphp @endforeach @endif
Product Details Quantity Price Total

{{$value['name']}}

Remove
₹{{number_format($value['price'],2)}} ₹{{number_format($value['price']*$value['quantity'],2)}}
@else

Your Cart is empty!

@endif Continue Shopping
@if(isset($cart))

Order Summary

  • TOTAL QTY {{$total_quantity}}
  • SUBTOTAL ₹{{number_format($subTotal,2)}}
  • Apply
@php $discount = 0; $coupon_dicount = 0; if(!empty($couponDetails)){ $coupon_type = $couponDetails['coupon_type']; if($coupon_type == 'fix_amount_all_product'){ foreach($cart as $key => $value){ $amount = $value['price']*$value['quantity']; if($couponDetails['coupon_amount'] < $value['price']){ $coupon_dicount = $coupon_dicount + ($couponDetails['coupon_amount']*$value['quantity']); } } }elseif($coupon_type == 'percentage_amount_all_product'){ foreach($cart as $key => $value){ $amount = $value['price']*$value['quantity']; $coupon_percentage_amount = ($value['price']*$couponDetails['coupon_amount'])/100; if($coupon_percentage_amount < $value['price']){ $coupon_dicount = $coupon_dicount + $coupon_percentage_amount*$value['quantity']; } } }elseif($coupon_type == 'fix_cart_discount'){ if($couponDetails['coupon_amount'] < $subTotal){ $coupon_dicount = $couponDetails['coupon_amount']; } }elseif($coupon_type == 'percentage_cart_discount'){ $coupon_percentage_amount = ($subTotal*$couponDetails['coupon_amount'])/100; if($coupon_percentage_amount < $subTotal){ $coupon_dicount = $coupon_dicount + $coupon_percentage_amount; } } } @endphp
    @if($coupon_dicount > 0) @php $subTotal = $subTotal - $coupon_dicount; @endphp
  • Coupon Discount ₹{{number_format($coupon_dicount,2)}}
  • @endif
  • Total ₹{{number_format($subTotal,2)}}
Proceed to Checkout
@endif
@endsection @section("js_after") @endsection