Hide 'publish to Shopify' button if any variant already has a shopify_variant_id
Deploy / deploy (push) Successful in 15s

Products imported before shopify_product_id column was added have null
there, but their variants already carry shopify_variant_id — that's
enough to know the product exists in Shopify. Running shopify:import
once will backfill shopify_product_id for all existing products.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Malek TellissiandClaude Sonnet 4.6 committed 2026-09-12 17:25:53 +02:00
1 parent 3450b06e32
commit 74b47193d9
1 file changed
+6 -1
@@ -24,7 +24,12 @@ class EditProduct extends EditRecord
->requiresConfirmation()
->modalHeading('Produkt in Shopify anlegen')
->modalDescription('Erstellt das Produkt mit allen Varianten in Shopify und verknüpft die IDs.')
->visible(fn () => ! $this->record->shopify_product_id)
->visible(fn () =>
! $this->record->shopify_product_id &&
! ProductSize::where('product_id', $this->record->id)
->whereNotNull('shopify_variant_id')
->exists()
)
->action(fn () => $this->createProductInShopify()),
Actions\Action::make('rezept-versionen')
->label('Rezept-Versionen')