@extends('layouts.mobile') @section('meta_title', ($currentCategory?->name ?? 'Browse Categories') . ' - Online Shopping | Gletra') @section('meta_description', $currentCategory ? 'Shop all products in ' . $currentCategory->name . ' on Gletra Mobile.' : 'Discover a wide range of categories including Fashion, Electronics, Home Decor and more on Gletra Mobile.') @section('content') @php $isCategoryProductsPage = request()->routeIs('mobile.category') && isset($products) && $currentCategory; $showingProducts = isset($products) && ! $isCategoryProductsPage; $isCategoryBrowsePage = ! $showingProducts && ! $isCategoryProductsPage; $activeParentId = null; if ($currentCategory && $isCategoryBrowsePage) { $activeParentId = $currentCategory->parent_id ?? $currentCategory->id; } @endphp @if($isCategoryProductsPage)
{{ $currentCategory->name }}
@if(Auth::check() && Auth::user()->role == 'admin') Manage @endif
@if($subcategoryFilters->isNotEmpty() && $filterParent)
All @foreach($subcategoryFilters as $sub) {{ $sub->name }} @endforeach
@endif
{{ $products->total() }} {{ Str::plural('product', $products->total()) }} Categories
@if($products->isEmpty())
No products in this category yet.
@else
@foreach($products as $product) @endforeach
@if($products->hasPages())
{{ $products->appends(['category' => $activeCategorySlug])->links('vendor.pagination.mobile') }}
@endif @endif
@else
{{ $showingProducts ? ($currentCategory?->name ?? 'All Products') : 'Gletra Categories' }}
@if(Auth::check() && Auth::user()->role == 'admin') Manage @endif
@foreach($categories as $index => $cat)
@include('partials.category-thumb', ['category' => $cat, 'size' => 42, 'rounded' => true])
{{ $cat->name }}
@endforeach
@if($showingProducts)
{{ $products->total() }} {{ Str::plural('product', $products->total()) }}
@if($products->isEmpty())
No products found in this category.
@else @if($products->hasPages())
{{ $products->links('vendor.pagination.mobile') }}
@endif @endif @else

{{ \App\Models\Setting::get('category_banner_title', 'Premium Curations') }}

{{ \App\Models\Setting::get('category_banner_subtitle', 'Quality assured daily finds') }}

{{ \App\Models\Setting::get('category_banner_button_text', 'SHOP NOW') }}
@php $bannerIcon = \App\Models\Setting::get('category_banner_icon', 'bi-bag-heart-fill'); @endphp
Select a category to browse subcategories
@foreach($categories as $index => $cat)
{{ $cat->name }} Essentials
View all
@forelse($cat->children as $sub)
@include('partials.category-thumb', ['category' => $sub, 'rounded' => true])
{{ $sub->name }}
@empty
View all {{ $cat->name }} products
@endforelse
@endforeach @endif
@endif @push('scripts') @endpush @endsection