Simple configuration changes so that it is easier to override the taxons and products url

This commit is contained in:
Sebastien Hoek 2025-12-23 00:28:15 +01:00
parent 1b49612af2
commit ef24f2951c
3 changed files with 19 additions and 12 deletions

View file

@ -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"

View file

@ -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: .+(?<!/)

View file

@ -0,0 +1,13 @@
# This file is part of the Sylius package.
# (c) Sylius Sp. z o.o.
sylius_shop_product_index:
path: /{slug}
methods: [GET]
defaults:
_controller: sylius.controller.product::indexAction
_sylius:
template: "@SyliusShop/product/index.html.twig"
grid: sylius_shop_product
requirements:
slug: .+(?<!/)