Explorar el Código

Affichage des sections dans les catégories parent

packProduct
Fab hace 2 años
padre
commit
0d1c49e36a
Se han modificado 1 ficheros con 15 adiciones y 9 borrados
  1. +15
    -9
      Definition/Field/Product/ProductCategoryFieldDefinition.php

+ 15
- 9
Definition/Field/Product/ProductCategoryFieldDefinition.php Ver fichero

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

Cargando…
Cancelar
Guardar