Sfoglia il codice sorgente

Affichage des sections dans les catégories parent

packProduct
Fab 2 anni fa
parent
commit
0d1c49e36a
1 ha cambiato i file con 15 aggiunte e 9 eliminazioni
  1. +15
    -9
      Definition/Field/Product/ProductCategoryFieldDefinition.php

+ 15
- 9
Definition/Field/Product/ProductCategoryFieldDefinition.php Vedi File

@@ -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),

Loading…
Annulla
Salva