{{-- Shared channel listing edit modal. Requires the HasChannelListingModal trait on the parent Livewire component. Properties used: $listingModalProductId, $listingEditRow, $listingModalSchema Methods used: closeListingModal(), saveListingModal() Which sections/fields render is driven by $listingModalSchema (a serialised ChannelModalSchema). Each platform's ChannelListingDriver::modalSchema() declares what it supports — no platform-specific if-statements needed here. Include with: @include('channels::filament.partials.listing-modal') --}} @if ($listingModalProductId !== null && !empty($listingEditRow)) @php $s = $listingModalSchema; $listingSections = $s['sections'] ?? []; $statusOptions = $s['status_options'] ?? []; $cmpHint = $s['compare_price_hint'] ?? ''; $hasSection = fn(string $name) => isset($listingSections[$name]); $hasField = function(string $section, string $field) use ($listingSections): bool { if (!isset($listingSections[$section])) return false; $fields = $listingSections[$section]; return empty($fields) || in_array($field, $fields, true); }; @endphp
{{-- Header --}}
{{ $listingEditRow['product_name'] }}
{{-- Body --}}
{{-- ── IMAGES ───────────────────────────────────────────────────── --}} @if (!empty($listingEditRow['_images']))

Images

Tick which images to include on this channel. Click ★ to set the featured (first) image.
@foreach ($listingEditRow['_images'] as $imgData) @php $fn = $imgData['filename']; $imgUrl = $imgData['url']; $isFeatured = $listingFeaturedImage === $fn; $isSelected = in_array($fn, $listingSelectedImages); @endphp
@if ($imgUrl) @endif
@endforeach

@endif {{-- ── LISTING ─────────────────────────────────────────────────── --}} @if ($hasSection('listing')) @php $restrictedTerms = \Webkul\Channel\Services\RestrictedTermChecker::termsFor((int) $listingModalChannelId); @endphp

Listing

@if ($restrictedTerms)
Restricted terms found: . Amazon may reject or remove this listing. Remove them before saving.
@endif @if ($hasField('listing', 'title')) @php $titleMaxLength = $s['title_max_length'] ?? null; @endphp
@if ($titleMaxLength) @endif
@endif @if ($hasField('listing', 'description'))
Overrides the product body on this channel. Clear to revert to the product description.
@endif @if ($hasField('listing', 'vendor') || $hasField('listing', 'product_type'))
@if ($hasField('listing', 'vendor'))
@endif @if ($hasField('listing', 'product_type'))
@endif
@endif @if ($hasField('listing', 'status') || $hasField('listing', 'tags'))
@if ($hasField('listing', 'status') && !empty($statusOptions))
@endif @if ($hasField('listing', 'tags'))
Comma-separated. Replaces all existing tags on save.
@endif
@endif

@endif {{-- ── CATEGORY (eBay only) ─────────────────────────────────────── --}} @if ($hasSection('category')) @php $cat = $listingEditRow['_category'] ?? null; $catSourceLabel = [ 'override' => ['Override', '#dbeafe', '#1e40af'], 'map' => ['Part-type map', '#d1fae5', '#065f46'], 'default' => ['Configurator default', '#fef3c7', '#92400e'], 'none' => ['Unresolved', '#fee2e2', '#991b1b'], ][$cat['source'] ?? 'none'] ?? ['Unresolved', '#fee2e2', '#991b1b']; $confidenceColor = fn ($c) => match ($c) { 'high' => '#059669', 'medium' => '#d97706', default => '#9ca3af', }; @endphp

eBay Category

{{ $cat['path'] ?? 'No category resolved' }} {{ $catSourceLabel[0] }}
@if (! empty($cat['warnings'])) @foreach ($cat['warnings'] as $warning) ⚠ {{ $warning }} @endforeach @endif @if (! empty($listingEditRow['ebay_category_id_override'])) @endif
or search manually below
{{-- Manual search --}}
@if (! empty($categorySearchResults))
@foreach ($categorySearchResults as $result)
{{ $result['path'] }}
@endforeach
@endif {{-- Suggestions --}} @if (! empty($categoryCandidates))
@foreach ($categoryCandidates as $i => $candidate)
{{ $candidate['path'] }} {{ $candidate['confidence'] }}
{{ $candidate['evidence'] }}
@if ($candidate['is_current'] ?? false) ✓ Currently selected @else @endif
@endforeach
@endif {{-- "Use for all similar" confirmation --}} @if ($categoryMapPendingKey)
This will map every product like this one ({{ $categoryMapAffectedCount }} product{{ $categoryMapAffectedCount === 1 ? '' : 's' }}) to this category going forward — they'll pick it up on their next save/sync, not immediately.
@endif

@endif {{-- ── PRICING ──────────────────────────────────────────────────── --}} @if ($hasSection('pricing'))

Pricing

@if ($hasField('pricing', 'price'))
£
@endif @if ($hasField('pricing', 'compare_at_price'))
@if ($cmpHint) {{ $cmpHint }} @endif
£
@endif

@endif {{-- ── SHIPPING ─────────────────────────────────────────────────── --}} @if ($hasSection('shipping'))

Shipping

@if ($hasField('shipping', 'weight'))
@if ($hasField('shipping', 'country_of_origin'))
@endif
@endif @if ($hasField('shipping', 'hs_code'))
Harmonised System code for customs. 6–10 digits.
@endif

@endif {{-- ── INVENTORY ────────────────────────────────────────────────── --}} @if ($hasSection('inventory'))

Inventory

@if ($hasField('inventory', 'barcode'))
@endif

@endif {{-- ── SEO ──────────────────────────────────────────────────────── --}} @if ($hasSection('seo'))

SEO

@if ($hasField('seo', 'seo_title'))
Shopify uses the listing title by default. Max 70 chars.
@endif @if ($hasField('seo', 'seo_description'))
Shopify uses the product description (HTML stripped) by default. Max 320 chars.
@endif

@endif {{-- ── URL ─────────────────────────────────────────────────────── --}} @if ($hasSection('url'))

URL

@if ($hasField('url', 'handle'))
Changing the handle changes the product URL. A 301 redirect will be created automatically from the old URL.
@endif
@endif
{{-- /body --}} {{-- Footer --}}
@if ($propagateModalOpen)
Apply title to…

Title to apply

{{ $listingEditRow['title'] ?: ($listingEditRow['_defaults']['title'] ?? '') }}

Apply to

@php $propagateChannels = \Webkul\Channel\Models\Channel::where('is_system', false) ->get()->filter(fn ($ch) => $ch->isConnected() && $ch->id !== $listingModalChannelId); @endphp @if ($propagateChannels->isNotEmpty())
@foreach ($propagateChannels as $ch) @endforeach @endif
@endif @endif