From 6119ba3dae0a1c5af80d4b6eb9f3419f5e17dfa2 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Fri, 26 Jun 2026 09:51:22 +0000 Subject: [PATCH] Load CRM catalog on the storefront edit form so products can be added MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The storefront editor has an 'Add from products' picker (+ per-item photo upload), but the edit page (storefronts.show) never passed the CRM $catalog to editor-fields, so the picker was hidden (x-show=catalog.length) — there was no way to add products to an existing storefront. show() now loads catalogProducts() and forwards it to the editor, matching the create form. Co-Authored-By: Claude Opus 4.8 --- app/Http/Controllers/Merchant/StorefrontController.php | 1 + resources/views/merchant/storefronts/show.blade.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Merchant/StorefrontController.php b/app/Http/Controllers/Merchant/StorefrontController.php index 58304e3..3fffe71 100644 --- a/app/Http/Controllers/Merchant/StorefrontController.php +++ b/app/Http/Controllers/Merchant/StorefrontController.php @@ -128,6 +128,7 @@ class StorefrontController extends Controller return view('merchant.storefronts.show', [ 'qrCode' => $storefront->fresh(), 'previewDataUri' => $this->imageGenerator->previewDataUri($storefront), + 'catalog' => $this->catalogProducts(), ]); } diff --git a/resources/views/merchant/storefronts/show.blade.php b/resources/views/merchant/storefronts/show.blade.php index e06f10f..37385bc 100644 --- a/resources/views/merchant/storefronts/show.blade.php +++ b/resources/views/merchant/storefronts/show.blade.php @@ -124,7 +124,7 @@ - @include('merchant.storefronts.partials.editor-fields', ['content' => $content]) + @include('merchant.storefronts.partials.editor-fields', ['content' => $content, 'catalog' => $catalog ?? []])