@extends('layouts.customer') @section('title', 'Cart') @section('content')
Home/ Cart
@php $total = 0; @endphp @if (!empty($cartItemBySeller)) SELECT ALL @endif @foreach ($cartItemBySeller as $sellerData) @php $sellerTotal = 0; @endphp

{{ $sellerData['seller']->shop->shop_name ?? 'N/A' }}

where('status', 0)->isEmpty()) checked @endif>
@foreach ($sellerData['cartItems'] as $item) @php $sellerTotal += $item->status == 1 ? optional($item->products->product_prices->where('is_active', 1)->sortByDesc('created_at')->first())->price * $item->prod_qty : 0; @endphp
status == 1) checked @endif>
@if ($item->products !== null && $item->products->product_images->isNotEmpty()) Image Here @endif
@if ($item->products !== null)
{{ $item->products->name }}
@endif
@if ($item->products !== null) @php $activePrice = $item->products->product_prices ->where('is_active', 1) ->sortByDesc('created_at') ->first(); @endphp @if ($activePrice)
₱ {{ number_format($activePrice->price, 2, '.', ',') }}
@endif @endif
@if ($item->products !== null)
{{ $item->prod_qty }} @if ($item->products->qty > $item->prod_qty) @else Quantity exceeds available stock @endif
@endif
@endforeach @php $total += $sellerTotal; @endphp
@endforeach





@if (empty($cartItemBySeller))

Your Cart is Empty

Continue Shopping
@endif
@auth
Total Amount:₱{{ number_format($total, 2, '.', ',') }}
Checkout
@else @endauth




@endsection @section('scripts') @endsection