@extends('inner_layout') @section('title') {{ __('Cart') }} @endsection @section('frontend_content')
@if ($carts && $carts->isNotEmpty())

Cart

@php $subtotal = 0; @endphp @foreach ($carts as $cart) @php $itemTotal = $cart->product ? $cart->product->finalPrice * $cart->quantity : 0; $subtotal += $itemTotal; @endphp @endforeach
{{ __('Product') }} {{ __('Price') }} {{ __('Quantity') }} {{ __('Subtotal') }} {{ __('Action') }}
{{ currency($cart->product ? $cart->product->finalPrice : 0) }}
{{ currency($itemTotal) }}

{{ __('Cart Totals') }}

@csrf

{{ __('Subtotals') }}

{{ currency($subtotal) }}

{{ __('Coupon offer') }}

@php $type = session('type'); $discountAmount = session('discount_amount', 0); $discount = 0; if ($subtotal) { if ($type === 'percentage') { $discount = ($subtotal * $discountAmount) / 100; } else { $discount = $discountAmount; } } $grandTotal = $subtotal - $discount; @endphp (-){{ currency($discount) }}

{{ __('Total') }}

{{ currency($grandTotal) }}

@if ($carts->isNotEmpty())
{{ __('Proceed to Checkout') }}
@endif

{{ __('Or continue shopping') }}

@else @include('ecommerce::frontend.not_found') @endif
@endsection @push('script_section') @endpush