From ef24f2951c7a95e830927ac77f9dd3bbf57e1912 Mon Sep 17 00:00:00 2001 From: Sebastien Hoek Date: Tue, 23 Dec 2025 00:28:15 +0100 Subject: [PATCH] Simple configuration changes so that it is easier to override the taxons and products url --- .../Bundle/ShopBundle/Resources/config/routing.yml | 5 +++++ .../ShopBundle/Resources/config/routing/product.yml | 13 +------------ .../ShopBundle/Resources/config/routing/taxon.yml | 13 +++++++++++++ 3 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 src/Sylius/Bundle/ShopBundle/Resources/config/routing/taxon.yml diff --git a/src/Sylius/Bundle/ShopBundle/Resources/config/routing.yml b/src/Sylius/Bundle/ShopBundle/Resources/config/routing.yml index b2b12f83aa..ef4a4b0e75 100644 --- a/src/Sylius/Bundle/ShopBundle/Resources/config/routing.yml +++ b/src/Sylius/Bundle/ShopBundle/Resources/config/routing.yml @@ -19,8 +19,13 @@ sylius_shop_security: sylius_shop_user: resource: "@SyliusShopBundle/Resources/config/routing/shop_user.yml" +sylius_shop_taxon: + resource: "@SyliusShopBundle/Resources/config/routing/taxon.yml" + prefix: /taxons + sylius_shop_product: resource: "@SyliusShopBundle/Resources/config/routing/product.yml" + prefix: /products sylius_shop_product_review: resource: "@SyliusShopBundle/Resources/config/routing/product_review.yml" diff --git a/src/Sylius/Bundle/ShopBundle/Resources/config/routing/product.yml b/src/Sylius/Bundle/ShopBundle/Resources/config/routing/product.yml index 00f859c7d1..52eb933ac6 100644 --- a/src/Sylius/Bundle/ShopBundle/Resources/config/routing/product.yml +++ b/src/Sylius/Bundle/ShopBundle/Resources/config/routing/product.yml @@ -2,7 +2,7 @@ # (c) Sylius Sp. z o.o. sylius_shop_product_show: - path: /products/{slug} + path: /{slug} methods: [GET] defaults: _controller: sylius.controller.product::showAction @@ -14,14 +14,3 @@ sylius_shop_product_show: - "expr:service('sylius.context.channel').getChannel()" - "expr:service('sylius.context.locale').getLocaleCode()" - $slug - -sylius_shop_product_index: - path: /taxons/{slug} - methods: [GET] - defaults: - _controller: sylius.controller.product::indexAction - _sylius: - template: "@SyliusShop/product/index.html.twig" - grid: sylius_shop_product - requirements: - slug: .+(?