diff --git a/app/config/common/services.yml b/app/config/common/services.yml index 49124f6d..9ee720ed 100644 --- a/app/config/common/services.yml +++ b/app/config/common/services.yml @@ -4,19 +4,19 @@ services: class: %jms_i18n_routing.locale_choosing_listener.class% public: false arguments: - - %jms_i18n_routing.default_locale% + - @elcodi.store_default_language_iso - @elcodi.languages_iso_array - @jms_i18n_routing.locale_resolver jms_i18n_routing.pattern_generation_strategy.default: class: %jms_i18n_routing.pattern_generation_strategy.class% arguments: - - %jms_i18n_routing.strategy% + - @elcodi.store_routing_strategy - @translator - @elcodi.languages_iso_array - %kernel.cache_dir% - %jms_i18n_routing.catalogue% - - %jms_i18n_routing.default_locale% + - @elcodi.store_default_language_iso # # Page renderer diff --git a/src/Elcodi/Admin/StoreBundle/Form/Type/StoreSettingsType.php b/src/Elcodi/Admin/StoreBundle/Form/Type/StoreSettingsType.php index 292d4839..268ba65a 100644 --- a/src/Elcodi/Admin/StoreBundle/Form/Type/StoreSettingsType.php +++ b/src/Elcodi/Admin/StoreBundle/Form/Type/StoreSettingsType.php @@ -18,10 +18,12 @@ namespace Elcodi\Admin\StoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\ChoiceList\ArrayChoiceList; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Elcodi\Component\Core\Factory\Traits\FactoryTrait; +use Elcodi\Component\Store\StoreRoutingStrategy; /** * Class StoreSettingsType @@ -89,6 +91,14 @@ public function buildForm(FormBuilderInterface $builder, array $options) ->add('useStock', 'checkbox', [ 'required' => false, ]) + ->add('routingStrategy', 'choice', [ + 'choice_list' => new ArrayChoiceList([ + 'admin.store.field.routingStrategy.prefix_except_default' => StoreRoutingStrategy::STRATEGY_PREFIX_EXCEPT_DEFAULT, + 'admin.store.field.routingStrategy.prefix' => StoreRoutingStrategy::STRATEGY_PREFIX, + 'admin.store.field.routingStrategy.custom' => StoreRoutingStrategy::STRATEGY_CUSTOM, + ]), + 'required' => true, + ]) ->add('enabled', 'checkbox', [ 'required' => false, ]); diff --git a/src/Elcodi/Admin/StoreBundle/Resources/views/Store/settings.html.twig b/src/Elcodi/Admin/StoreBundle/Resources/views/Store/settings.html.twig index 1b2132b1..5502b96b 100644 --- a/src/Elcodi/Admin/StoreBundle/Resources/views/Store/settings.html.twig +++ b/src/Elcodi/Admin/StoreBundle/Resources/views/Store/settings.html.twig @@ -73,6 +73,28 @@ +
+ +
+
+

{{ 'admin.store.section.advanced.title'|trans }}

+

{{ 'admin.store.section.advanced.description'|trans }}

+
+
+
+
+
    +
  1. + {{ + form_row(form.routingStrategy, { + label: 'admin.store.field.routingStrategy.title', + }) + }} +
  2. +
+
+
+