{{-- Auto Shopify sync gate: blockers / success — professional status panel --}} @php $autoStatus = (string) ($import->auto_status ?? ''); $formAuto = is_array($import->form_data) ? $import->form_data : []; $autoBlockers = is_array($formAuto['auto_blockers'] ?? null) ? $formAuto['auto_blockers'] : []; $autoWarnings = is_array($formAuto['auto_warnings'] ?? null) ? $formAuto['auto_warnings'] : []; // Already linked to Shopify → never keep showing a stale Auto failed/blocked banner. if ((bool) $import->is_auto_mode && filled($import->shopify_product_gid) && in_array($autoStatus, [ \App\Models\ProductAiImport::AUTO_STATUS_FAILED, \App\Models\ProductAiImport::AUTO_STATUS_BLOCKED, ], true)) { $import->clearStaleAutoFailureAfterShopify(); $import->refresh(); $autoStatus = (string) ($import->auto_status ?? ''); $formAuto = is_array($import->form_data) ? $import->form_data : []; $autoBlockers = is_array($formAuto['auto_blockers'] ?? null) ? $formAuto['auto_blockers'] : []; $autoWarnings = is_array($formAuto['auto_warnings'] ?? null) ? $formAuto['auto_warnings'] : []; } $showAutoGate = (bool) $import->is_auto_mode && in_array($autoStatus, [ \App\Models\ProductAiImport::AUTO_STATUS_BLOCKED, \App\Models\ProductAiImport::AUTO_STATUS_SYNCED, \App\Models\ProductAiImport::AUTO_STATUS_FAILED, \App\Models\ProductAiImport::AUTO_STATUS_DONE, ], true); // Live re-assess when blocked so fixing fields updates the list after refresh. if ($showAutoGate && $autoStatus === \App\Models\ProductAiImport::AUTO_STATUS_BLOCKED) { try { $live = app(\App\Services\ProductAiShopifyReadinessService::class)->assess($import); $autoBlockers = $live['blockers']; $autoWarnings = $live['warnings']; } catch (\Throwable) { // keep stored snapshot } } $adminUrlGate = is_array($formAuto) ? ($formAuto['shopify_admin_url'] ?? null) : null; // Don't stack "draft created" on top of pending Update — one action at a time. $hasPendingPush = filled($import->shopify_product_gid) && ($import->hasPendingShopifySync() || $import->shopifyPayloadNeedsPrepare()); @endphp @if($showAutoGate) @if($autoStatus === \App\Models\ProductAiImport::AUTO_STATUS_SYNCED && $import->shopify_product_gid && ! $hasPendingPush)

Shopify draft created

{{ $import->auto_message ?: 'Auto finished and created a DRAFT in Shopify.' }}

@if($adminUrlGate) Open in Shopify admin @endif Review listing
@elseif($autoStatus === \App\Models\ProductAiImport::AUTO_STATUS_FAILED && ! filled($import->shopify_product_gid))

Auto stopped

{{ $import->auto_message ?: ($import->error_message ?: 'Something failed during the auto pipeline.') }}

Fix the issue below, then continue the wizard and use Create Shopify Draft when ready.

@elseif(($autoStatus === \App\Models\ProductAiImport::AUTO_STATUS_BLOCKED || count($autoBlockers)) && ! filled($import->shopify_product_gid))
Auto · Shopify sync paused

Cannot sync until these are resolved

Everything else ran, but Shopify was not created. Resolve each item, then use Create Shopify Draft on the Shopify step.

@if(count($autoBlockers))
    @foreach($autoBlockers as $b) @php $fix = $b['fix'] ?? 'shopify'; $fixUrl = $fix ? route('product-ai-import.show', ['productAiImport' => $import, 'step' => $fix]) : null; @endphp
  1. {{ $b['title'] ?? 'Issue' }}
    {{ $b['detail'] ?? '' }}
    @if($fixUrl) Go to {{ ucfirst($fix) }} → @endif
  2. @endforeach
@endif @if(count($autoWarnings))
Notes (optional)
    @foreach($autoWarnings as $w)
  • {{ $w['title'] ?? '' }} — {{ $w['detail'] ?? '' }}
  • @endforeach
@endif
@endif @endif