@extends('frontend.layouts.app') @section('contents') @php $cartSubTotal = 0; @endphp @php $currencyIcon = \App\Models\Setting::where('key', 'site_currency_icon')->value('value'); @endphp

Your Cart

There are {{ cartCount() }} products in your cart
{{--
Clear Cart
--}}
@if(is_object($cartItems)) @forelse($cartItems as $cartKey => $cartItem) @php $price = null; if (is_object($cartItem) && $cartItem->product) { $price = $cartItem->product->getVariantOrProductPriceAndStock($cartItem->variant_id); $cartSubTotal += $price['price'] * $cartItem->quantity; } else if (!is_object($cartItem)) { // Guest user cart item $cartSubTotal += $cartItem['price'] * $cartItem['quantity']; } @endphp @if (is_object($cartItem)) @if ($price && $price['in_stock']) @else @endif @else @endif @empty @endforelse @else @forelse($cartItems as $cartKey => $cartItem) @empty @endforelse @endif
Product Unit Price Quantity Subtotal Remove
#
{{ is_object($cartItem) ? $cartItem->product?->name : $cartItem['name'] }}
{{ is_object($cartItem) ? ($cartItem->product?->variants()->where('id', $cartItem->variant_id)->first()->name ?? '') : '' }}
(4.0)
@if ($price && $price['old_price'])

{{ $currencyIcon }}{{ $price ? $price['price'] : 0 }}

{{ $currencyIcon }} {{ $price ? $price['old_price'] : 0 }}

@else

{{ $currencyIcon }}{{ $price['price'] }}

@endif

{{ $currencyIcon }}{{ $price['price'] * $cartItem->quantity }}

Out of stock

{{ $currencyIcon }}{{ $cartItem['price'] }}

{{ $currencyIcon }}{{ $cartItem['price'] * $cartItem['quantity'] }}

Cart is empty
#
{{ $cartItem['name'] }}

{{ $currencyIcon }}{{ $cartItem['price'] }}

{{ $currencyIcon }}{{ $cartItem['price'] * $cartItem['quantity'] }}

Cart is empty
@if(cartCount() > 0)

Apply Coupon

Using A Promo Code?

@csrf
@if (session()->has('coupon')) @else @endif
@endif
@if (session()->has('coupon')) @php $discount = session('coupon')['coupon_type'] != 'fixed' ? $cartSubTotal * (session('coupon')['coupon_value'] / 100) : session('coupon')['coupon_value']; @endphp @else @endif
Subtotal

{{ $currencyIcon }} {{ $cartSubTotal }}

Discount @if (session('coupon')['coupon_type'] == 'fixed') (fixed) @else ({{ session('coupon')['coupon_value'] }}%) @endif
{{ $currencyIcon }} {{ $discount }}
Total

{{ $currencyIcon }}{{ $cartSubTotal - $discount }}

Discount
{{ $currencyIcon }}0
Total

{{ $currencyIcon }} {{ $cartSubTotal }}

@if(cartCount() > 0) Proceed To CheckOut @endif
@endsection @push('scripts') @endpush