@extends('front.layout.master') @section('meta_tags') {{ __('All Categories') }} - {{ config('app.name') }} @endsection @section('body')
{{-- Breadcrumb --}} {{-- Header --}}

@if($level === 'category') {{ __('All Categories') }} @elseif($level === 'sub') {{ $parentCategory->title }} @elseif($level === 'child') {{ $parentSubcategory->title }} @endif

@if($level === 'category') {{ __('Browse all departments and explore products') }} @elseif($level === 'sub') {{ __('Choose a sub-category to continue') }} @elseif($level === 'child') {{ __('Choose a sub-section to view products') }} @endif

@if($level === 'sub' && $parentCategory) {{ __('Skip — view all products in') }} {{ $parentCategory->title }} → @elseif($level === 'child' && $parentSubcategory) {{ __('Skip — view all products in') }} {{ $parentSubcategory->title }} → @endif
@if($items->isEmpty())

{{ __('Nothing here yet') }}

{{ __('Categories will appear here once added.') }}

← {{ __('Back to home') }}
@else
@foreach($items as $item) @php if ($level === 'category') { $imgDir = 'images/category/'; $hasChildren = $item->subcategory ? $item->subcategory->where('status','1')->count() : 0; $href = $hasChildren > 0 ? url('categories?cat=' . $item->id) : $item->getURL(); } elseif ($level === 'sub') { $imgDir = 'images/subcategory/'; $hasChildren = $item->childcategory ? $item->childcategory->where('status','1')->count() : 0; $href = $hasChildren > 0 ? url('categories?sub=' . $item->id) : $item->getURL(); } else { $imgDir = 'images/grandcategory/'; $hasChildren = 0; $href = $item->getURL(); } $imgFile = $item->image ?: $item->icon; $imgPath = $imgFile && file_exists(public_path() . '/' . $imgDir . $imgFile) ? url($imgDir . $imgFile) : null; @endphp
@if($imgPath) {{ $item->title }} @else @endif @if($hasChildren > 0) {{ $hasChildren }} @endif

{{ $item->title }}

@if($hasChildren > 0) {{ $hasChildren }} {{ $level === 'category' ? __('sub-categories') : __('sections') }} @else {{ __('View products') }} → @endif
@endforeach
@endif
@endsection