@php $categories = $this->partCategories; $groups = $this->pspTermGroups; $selected = $this->selectedCategory; $mappingUrl = \Webkul\AllmakesPsp\Filament\Pages\AllmakesCategoryMapping::getUrl(); $stockUrl = \Webkul\AllmakesPsp\Filament\Pages\AllmakesDashboard::getUrl(); $dataUrl = \Webkul\AllmakesPsp\Filament\Pages\AllmakesProductData::getUrl(); $overviewUrl = \Webkul\AllmakesPsp\Filament\Pages\AllmakesConnector::getUrl(); $terrafirmaUrl = \Webkul\AllmakesPsp\Filament\Pages\TerrafirmaConnector::getUrl(); @endphp
{{-- Sub-navigation --}} {{-- Two-panel layout --}}
{{-- LEFT: Part category list --}}
Cydekick Part Categories
Your product taxonomy — left is Cydekick, right is PSP
@foreach($categories as $cat) @endforeach
{{-- RIGHT: PSP term picker --}} @if($selected)
{{-- Header bar --}}
{{ $selected }}
Tick PSP catnames / subcatnames to map — changes save automatically
Saving… @if(!in_array($selected, ['Accessories & More','Axles & Suspension','Body & Chassis','Braking System','Cooling & Climate','Electrical','Engine Parts','Exhaust System','Fuel & Air','Powertrain & Clutch','Service & Maintenance','Steering'])) @endif @php $stats = $this->applyStats; @endphp {{-- Export CSV: always show when any mappings exist --}} @if(!empty($stats['mapped_part_cats'] ?? [])) @endif {{-- Update button: only when products need moving --}} @if($stats['product_count'] > 0 && $stats['has_changes']) @elseif($stats['product_count'] === 0 && !empty($stats['mapped_part_cats'] ?? [])) All products categorised @endif
{{-- Alpine-driven loading overlay (avoids wire:loading.style which is not valid in Livewire 3) --}}
Loading…
{{-- Groups content — dimmed via Alpine while category is loading --}}
{{-- PSP catname groups --}} @foreach($groups as $group) @php $hasChecked = $group['all_checked'] || collect($group['subcats'])->contains('checked', true); $checkedSubCount = collect($group['subcats'])->where('checked', true)->count(); $hasPartialSubcat = $checkedSubCount > 0 && ! $group['all_checked']; @endphp
{{-- Catname header row --}}
{{ $group['catname'] }} @if($hasPartialSubcat) {{ $checkedSubCount }} sub @endif {{ number_format($group['total_skus']) }} SKUs
{{-- Subcatname rows --}}
@foreach($group['subcats'] as $sub) @endforeach
@endforeach
{{-- end .cm-groups-visible wrapper --}}
@else
Select a part category from the left to configure its PSP term mappings.
@endif
{{-- Delete confirmation modal --}} @if($showDeleteModal)
Remove Category
Remove {{ $selectedCategory }} and all its PSP term links? This will not delete any products from the category tree — run Apply to Products first if you need to reassign them.
@endif