diff --git a/src/Form/Extension/ProductOptionTypeExtension.php b/src/Form/Extension/ProductOptionTypeExtension.php index a4425452..b23baf62 100644 --- a/src/Form/Extension/ProductOptionTypeExtension.php +++ b/src/Form/Extension/ProductOptionTypeExtension.php @@ -30,15 +30,15 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $builder ->add('searchable', CheckboxType::class, [ - 'label' => 'monsieurbiz_searchplugin.admin.product_attribute.form.searchable', + 'label' => 'monsieurbiz_searchplugin.admin.product_option.form.searchable', 'required' => true, ]) ->add('filterable', CheckboxType::class, [ - 'label' => 'monsieurbiz_searchplugin.admin.product_attribute.form.filterable', + 'label' => 'monsieurbiz_searchplugin.admin.product_option.form.filterable', 'required' => true, ]) ->add('search_weight', ChoiceType::class, [ - 'label' => 'monsieurbiz_searchplugin.admin.product_attribute.form.search_weight', + 'label' => 'monsieurbiz_searchplugin.admin.product_option.form.search_weight', 'required' => true, 'choices' => array_combine($searchWeightValues, $searchWeightValues), ]) diff --git a/src/Resources/config/config.yaml b/src/Resources/config/config.yaml index 940e85b1..7bfc5043 100644 --- a/src/Resources/config/config.yaml +++ b/src/Resources/config/config.yaml @@ -3,6 +3,7 @@ imports: - { resource: "monsieurbiz_search.yaml" } - { resource: "sylius/ui.yaml" } - { resource: "sylius/fixtures.yaml" } + - { resource: "sylius/grids.yaml" } - { resource: "monsieurbiz/settings.yaml" } - { resource: "messenger.yaml" } diff --git a/src/Resources/config/sylius/grids.yaml b/src/Resources/config/sylius/grids.yaml new file mode 100644 index 00000000..14e95adb --- /dev/null +++ b/src/Resources/config/sylius/grids.yaml @@ -0,0 +1,52 @@ +sylius_grid: + grids: + sylius_admin_product_attribute: + fields: + filterable: + type: twig + label: monsieurbiz_searchplugin.admin.product_attribute.form.filterable + sortable: ~ + options: + template: "@SyliusUi/Grid/Field/yesNo.html.twig" + searchable: + type: twig + label: monsieurbiz_searchplugin.admin.product_attribute.form.searchable + sortable: ~ + options: + template: "@SyliusUi/Grid/Field/yesNo.html.twig" + searchWeight: + label: monsieurbiz_searchplugin.admin.product_attribute.form.search_weight_short_label + type: string + sortable: ~ + filters: + filterable: + type: boolean + label: monsieurbiz_searchplugin.admin.product_attribute.form.filterable + searchable: + type: boolean + label: monsieurbiz_searchplugin.admin.product_attribute.form.searchable + sylius_admin_product_option: + fields: + filterable: + type: twig + label: monsieurbiz_searchplugin.admin.product_option.form.filterable + sortable: ~ + options: + template: "@SyliusUi/Grid/Field/yesNo.html.twig" + searchable: + type: twig + label: monsieurbiz_searchplugin.admin.product_option.form.searchable + sortable: ~ + options: + template: "@SyliusUi/Grid/Field/yesNo.html.twig" + searchWeight: + label: monsieurbiz_searchplugin.admin.product_option.form.search_weight_short_label + type: string + sortable: ~ + filters: + filterable: + type: boolean + label: monsieurbiz_searchplugin.admin.product_option.form.filterable + searchable: + type: boolean + label: monsieurbiz_searchplugin.admin.product_option.form.searchable diff --git a/src/Resources/translations/messages.en.yml b/src/Resources/translations/messages.en.yml index 3eed8484..c3cde1be 100644 --- a/src/Resources/translations/messages.en.yml +++ b/src/Resources/translations/messages.en.yml @@ -6,10 +6,14 @@ monsieurbiz_searchplugin: filterable: Filterable searchable: Searchable search_weight: Search Weight + search_weight_short_label: Weight product_option: form: title: Search filterable: Filterable + searchable: Searchable + search_weight: Search Weight + search_weight_short_label: Weight setting_form: instant_search_enabled_monsieurbiz_product: 'Product: Instant search enabled' limit_search_monsieurbiz_product: 'Product: Available limits for search' diff --git a/src/Resources/translations/messages.fr.yml b/src/Resources/translations/messages.fr.yml index 305eab2b..85df4595 100644 --- a/src/Resources/translations/messages.fr.yml +++ b/src/Resources/translations/messages.fr.yml @@ -6,10 +6,14 @@ monsieurbiz_searchplugin: filterable: Filtrable searchable: Recherchable search_weight: Pondération dans la recherche + search_weight_short_label: Poids product_option: form: title: Recherche filterable: Filtrable + searchable: Recherchable + search_weight: Pondération dans la recherche + search_weight_short_label: Poids setting_form: instant_search_enabled_monsieurbiz_product: 'Produit: Activer la recherche instantanée' limit_search_monsieurbiz_product: 'Produit: Limites disponibles pour la recherche'