@stack('styles')
@include('store.partials.header')
@if(session('success'))
@endif
@if(session('error'))
@endif
@yield('content')
@include('store.partials.footer')
{{-- Floating Cart Button (Mobile) --}}
@php
if(auth()->guard('web')->check()) {
$floatingCart = \App\Models\Cart::where('user_id', auth()->guard('web')->id())->with('items')->first();
} else {
$floatingCart = \App\Models\Cart::where('session_id', session()->getId())->with('items')->first();
}
$floatingCartCount = $floatingCart ? $floatingCart->items->sum('quantity') : 0;
@endphp
@if($floatingCartCount > 0)
{{ $floatingCartCount > 99 ? '99+' : $floatingCartCount }}
@endif
@stack('scripts')