Pārlūkot izejas kodu

Affichage des sections dans les catégories parent

packProduct
Fab pirms 2 gadiem
vecāks
revīzija
0d1c49e36a
1 mainītis faili ar 15 papildinājumiem un 9 dzēšanām
  1. +15
    -9
      Definition/Field/Product/ProductCategoryFieldDefinition.php

+ 15
- 9
Definition/Field/Product/ProductCategoryFieldDefinition.php Parādīt failu

@@ -57,14 +57,14 @@ class ProductCategoryFieldDefinition extends AbstractFieldDefinition
public function configurePanelMain(): array
{
return [
'section',
'parent',
'title',
'description',
'image',
'status',
'saleStatus',
'isEligibleTicketRestaurant',
'section',
'parent',
'title',
'description',
'image',
'status',
'saleStatus',
'isEligibleTicketRestaurant',
];
}

@@ -78,7 +78,13 @@ class ProductCategoryFieldDefinition extends AbstractFieldDefinition
'title' => TextField::new('title')->setSortable(true),
'position' => NumberField::new('position')->setSortable(true),
'parent' => AssociationField::new('parent')
->setFormTypeOption('choices', $productCategoryArray),
->setFormTypeOption('choices', $productCategoryArray)
->setFormTypeOption(
'choice_label',
function ($productCategory) {
return $productCategory->getTitle() . ' (' . $productCategory->getSection() . ')';
}
),
'image' => ImageManagerField::new('image'),
'description' => CKEditorField::new('description'),
'saleStatus' => ToggleField::new('saleStatus')->setSortable(true),

Notiek ielāde…
Atcelt
Saglabāt