@php $genral = App\Genral::first(); $banner = App\BannerSetting::first(); $allCats = App\Category::where('status', '1')->orderBy('position')->get(); $headerCats = $allCats->take(11); $cartCount = 0; $wishlistCount = 0; if (Auth::check()) { $cartCount = App\Cart::where('user_id', Auth::user()->id)->count(); // Count only wishlist rows that will actually render on the wishlist page: // the variant's product must still exist & be active, or it's a simple product. // Mirrors MainController::wishlist_show() so the badge never shows a phantom // count for a soft-deleted variant/product left behind in the table. $wishlistCount = App\Wishlist::where('user_id', Auth::user()->id) ->where(function ($q) { $q->whereHas('variant.products', function ($s) { $s->where('status', '1'); }) ->orWhereHas('simple_product'); })->count(); } else { $cartCount = Session::get('cart') ? count((array) Session::get('cart')) : 0; } $compareCount = count((array) session('comparison', [])); @endphp {{-- ===================== TOP UTILITY BAR ===================== --}}
@if($banner && $banner->status == '1') @php $bannerText = \Illuminate\Support\Str::limit(strip_tags($banner->content), 90); @endphp @if(!empty($banner->url)) @else @endif @else @endif
@if(isset($genrals_settings) && $genrals_settings['vendor_enable'] == 1) @endif {{ __('Track order') }} @php $curLangCode = Session::get('changed_language') ?: 'en'; $curLangName = optional(collect($langauges)->firstWhere('lang_code', $curLangCode))->name ?? (optional(collect($langauges)->first())->name ?? 'English'); @endphp @if(App\AutoDetectGeo::first()->enabel_multicurrency == '1') @php // Normalise the enabled-currency list (same two sources the old {{-- Dropdown menu lives OUTSIDE the form so the form's rounded clipping doesn't hide it --}}
@if(Auth::check()) @else @endif @php if (!Auth::check()) { $wishlistCount = count((array) session('guest_wishlist', [])); } @endphp
{{-- Category nav (dynamic) --}}
{{-- ===================== MOBILE MENU DRAWER ===================== --}}
{{-- Hidden filter form --}}