@extends('front.layouts.app') @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; $itemName = 'Unknown'; $itemLink = '#'; $itemType = 'product'; if ($item->astrologer_pooja_service_id && $item->poojaService) { $itemType = 'pooja'; $itemName = $item->poojaService->poojaService->name ?? ($item->poojaService->custom_name ?? 'Ritual Service'); $itemLink = route('pooja-services.show', $item->poojaService->poojaService->slug ?? 'service'); $img = $item->poojaService->custom_image ?? ($item->poojaService->poojaService->image ?? null); if ($img) $img = asset('storage/' . $img); } else if ($item->product) { $itemName = $item->product->name; $itemLink = route('shop.product', $item->product->slug); 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
    {{ $itemName }}
    @if($itemType === 'pooja' && $item->poojaService)

    Expert: {{ $item->poojaService->user->name }}

    @endif @if($item->variation)

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

    @endif

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

    @if($itemType === 'product')
    @csrf
    @else
    Qty: {{ $item->quantity }}
    @endif
    @if($itemType === 'product')
    @csrf
    @endif 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 = 0; foreach ($cart->items as $item) { $subtotal += $item->price * $item->quantity; } $shipping = 0; $total = $subtotal + $shipping; @endphp
Subtotal
₹{{ number_format($subtotal, 2) }}
@if($automaticDiscount > 0)
Automatic Discount
-₹{{ number_format($automaticDiscount, 2) }}
@endif
Order Total
₹{{ number_format($subtotal - $automaticDiscount, 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