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

Shopping Cart

@if(session('success'))

{{ session('success') }}

@endif @if(session('error'))

{{ session('error') }}

@endif

Items in your shopping cart

@if($cart && $cart->items->count() > 0)
    @foreach($cart->items as $item)
  • @php $img = null; if ($item->variation && $item->variation->image_path) { $img = $item->variation->image_path; } else { $mainImage = $item->product->images->sortBy('sort_order')->first(); $img = $mainImage ? $mainImage->image_path : null; } $imagePath = $img ?? 'https://placehold.co/200x200?text=No+Image'; @endphp
    {{ $item->product->name }}
    @if($item->variation)

    @foreach($item->variation->options as $option) {{ $option->attribute_value }} @if(!$loop->last) / @endif @endforeach

    @endif

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

    @csrf
    @csrf
    Remove
  • @endforeach
@else

Your cart is empty

Before you proceed to checkout, you must add some products to your shopping cart.

Start Shopping
@endif
@if($cart && $cart->items->count() > 0)

Order Summary

@php $subtotal = $cart->items->sum(function ($item) { return $item->price * $item->quantity; }); $shipping = 0; $total = $subtotal + $shipping; @endphp
Subtotal
₹{{ number_format($subtotal, 2) }}
Order Total
₹{{ number_format($total, 2) }}

Shipping & taxes calculated at checkout

Secure Payment
Free Shipping
30 Day Returns
@endif
@if(isset($crossSellProducts) && $crossSellProducts->count() > 0)

You may also like

@foreach($crossSellProducts as $product)
@php $imageUrl = $product->images->sortBy('sort_order')->first()?->image_path ?? 'https://placehold.co/300x300?text=No+Image'; @endphp {{ $product->name }}
@csrf

{{ $product->name }}

{{ $product->category->name ?? '' }}

₹{{ number_format($product->sp, 2) }}

@endforeach
@endif
@endsection