diff --git a/packages/admin/src/Filament/Resources/ProductResource.php b/packages/admin/src/Filament/Resources/ProductResource.php index 724c09a1a..c11b1fab6 100644 --- a/packages/admin/src/Filament/Resources/ProductResource.php +++ b/packages/admin/src/Filament/Resources/ProductResource.php @@ -99,7 +99,7 @@ public static function getWidgets(): array public static function getDefaultForm(Form $form): Form { return $form - ->schema([ + ->schema(fn (Product $record) => [ Shout::make('product-status') ->content( __('lunarpanel::product.status.unpublished.content') @@ -123,6 +123,19 @@ public static function getDefaultForm(Form $form): Form static::getMainFormComponents(), ), static::getAttributeDataFormComponent(), + ...( + $record->variants->count() === 1 ? + [Forms\Components\Repeater::make('variants') + ->relationship() + ->schema([ + Attributes::make()->statePath('attribute_data') + ]) + ->maxItems(1) + ->addable(false) + ->deletable(false) + ->label('Variant details')] : + [] + ) ]) ->columns(1); }