@extends('layouts.app') @section('title', 'Shopping Cart') @section('content')

Shopping Cart

Review your items and proceed to checkout

@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if($cartItems->count() > 0)

Cart Items ({{ $cartItems->count() }})

@csrf @method('DELETE')
@foreach($cartItems as $item)

{{ $item->book->title }}

by {{ $item->book->author }}

{{ $item->book->category->name }} @if($item->book->language !== 'English') {{ $item->book->language }} @endif
@csrf @method('DELETE')
@if($item->book->stock === 'out_of_stock') Out of Stock! @elseif($item->book->stock === 'limited_stock') Limited Stock @endif

₹{{ number_format($item->total_price, 2) }}

₹{{ number_format($item->price, 2) }} each

@endforeach

Order Summary

Subtotal ({{ $cartItems->sum('quantity') }} items) ₹{{ number_format($subtotal, 2) }}
@php $totalQuantity = $cartItems->sum('quantity'); $minBulkPurchase = \App\Models\Setting::get('min_bulk_purchase', 10); $isBulkPurchase = $totalQuantity >= $minBulkPurchase; @endphp
Shipping Calculated at checkout

Shipping charges will be calculated at checkout based on state selection.

@if($isBulkPurchase)

Congratulations! You will be qualified for a special discount on the shipping charges on bulk quantity ({{ $minBulkPurchase }}+ items) purchase!

@endif
Total ₹{{ number_format($subtotal, 2) }}
@else

Your cart is empty

Start shopping to add items to your cart.

@endif
@endsection