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

Billing Details

@if ($errors->has('name')) @endif
@if ($errors->has('street_name')) @endif
@if ($errors->has('city')) @endif
@if ($errors->has('state')) @endif
@if ($errors->has('zip_code')) @endif
@if ($errors->has('phone_no')) @endif
@if ($errors->has('email')) @endif

Your Order

@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 @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 @endif
PRODUCT TOTAL
{{$value['name']}} × {{$value['quantity']}} ₹{{number_format($value['price']*$value['quantity'],2)}}
SUBTOTAL ₹{{number_format($subTotal,2)}}
Coupon Discount ₹{{number_format($coupon_dicount,2)}}
TOTAL ₹{{number_format($subTotal,2)}}
@endsection