@extends('shop.layouts.app') @section('title', 'Shopping Cart') @section('content')
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if($cartItems->isEmpty())

Your cart is empty

Looks like you haven't added any products yet.

Start Shopping
@else
@foreach($cartItems as $item)
@if($item->product->primaryImage) {{ $item->product->name }} @else
@endif

{{ $item->product->name }}

@if($item->product->category) {{ $item->product->category->name }} @endif @if($item->product->is_on_sale) -{{ $item->product->discount_percentage }}% @endif
KSh {{ number_format($item->product->effective_price, 2) }} @if($item->product->is_on_sale) KSh {{ number_format($item->product->price, 2) }} @endif
@if($item->product->requires_installation)
@csrf @method('PATCH')
@endif
@csrf @method('PATCH')
Subtotal KSh {{ number_format($item->total, 2) }} @if($item->installation_cost > 0) (incl. installation) @endif
@csrf @method('DELETE')
@endforeach

Order Summary

Subtotal ({{ $cartItems->sum('quantity') }} items) KSh {{ number_format($subtotal, 2) }}
@if($installationTotal > 0)
Installation KSh {{ number_format($installationTotal, 2) }}
@endif
Total KSh {{ number_format($total, 2) }}
@csrf
@csrf @method('DELETE')
Continue Shopping
@endif
@endsection