Setono / SyliusTermsPlugin

Add terms and conditions to your Sylius store and have the customer accept them on checkout
MIT License
34 stars 12 forks source link

Prevent collisions with the paths of other routes #7

Closed 4c0n closed 5 years ago

4c0n commented 5 years ago

After installing the plugin, when using the debug:router command to check what routes the plugin adds, I see the following:

setono_sylius_terms_show                                       GET              ANY      ANY    /{_locale}/{slug}                                                                                               
  setono_sylius_terms_partial_show                               GET              ANY      ANY    /{_locale}/{slug}/partial

Considering that the route for the cart for example looks like:

sylius_shop_cart_summary                                       GET              ANY      ANY    /{_locale}/cart/

Then cart is interpreted as the slug for the terms and conditions. This change makes the route path look like:

setono_sylius_terms_show                                       GET              ANY      ANY    /{_locale}/terms/{slug}
igormukhingmailcom commented 5 years ago

We had routes like this before but ended up with idea that /terms/ in path will not be OK for non-en_XX stores. And idea was to import terms routes at the end of main routing file - that way it will be handled with lowest priority.

@4c0n Have you tried to import routes at the end?

loevgaard commented 5 years ago

Hi @igormukhingmailcom

I talked to @4c0n on Slack and explained our reasoning, but I think we need to merge this now, and then I will add an issue so we can work on the more beautiful/correct URLs in the future