@php use App\AttributeSet; use App\Attribute; use App\Brand; use App\Review; use App\Cart; use App\Shipping; use App\City; use App\Product; use App\ProductImage; $cities = City::orderBy('priority', 'asc')->get(); $shippingcharge = Shipping::find(1); $carts = new Cart; $carts = $carts->carts(); $carts = Session::get('product'); @endphp @extends('frontend.layouts.home') @extends('frontend.layouts.reviewstyle') @section('content')
@if(Session::has('product')) @csrf @php if (Session::has('product')) { $cart_counts = max(array_keys($carts['id'])); $total_products =0; }else { $cart_counts = 0; } @endphp @for($i = 0; $i <= $cart_counts; $i++) @php if (isset($carts['quantity'][$i])) { $total_products += $carts['quantity'][$i]; } @endphp @endfor @php $total_pcire = 0; $total_product_price = 0; @endphp @for($i = 0; $i <= $cart_counts; $i++) @if(isset($carts['price'][$i])) @php $total_pcire += $carts['price'][$i]; $total_product_price += $carts['price'][$i]; $product = Product::find($carts['id'][$i]); $product_image = ProductImage::where('product_id',$carts['id'][$i])->first(); @endphp @if(isset($product)) @endif @endif @endfor @php $total_pcire = $total_pcire + Session::get('shipping'); @endphp @endif
Product Price Qty Subtotal
@if(!is_null($product)) @if(!is_null($product_image)) cart @else cart @endif @else This Product not available @endif

{{ $product->title }}

Tk. {{ $carts['mainprice'][$i] }}
@if($carts['quantity'][$i] <= 1) - @else - @endif +
Tk. @php echo $carts['price'][$i]; @endphp

Summary

    @if(Session::has('product')) @else There is no product in cart. @endif
Subtotal Tk. @if(isset($total_product_price)){{$total_product_price}}@endif
Shipping @if(Session::has('shipping')) {{Session::get('shipping')}} @endif
Order Total Tk.@if(isset($total_product_price)){{ $total_pcire }} @php Session::put('sub_total', $total_pcire); @endphp @endif
@if(Session::has('product')) @endif
@endsection @section('script') @endsection