Page 1 of 1

Customize checkout urls

Posted: 23 Oct 2021, 08:22
by niloofar
Hi.

I have changed checkout steps in the config like below:

Code: Select all

'html' => [
    'checkout' => [
         'subparts' => ['shipping', 'checkout', 'process']
    ]
]
I've created the necessary classes and everything works fine.

However, the URLs for each step are like this:

Code: Select all

/shop/default/checkout                              for shipping step
/shop/default/checkout/checkout                     for checkout step
But I want them to be:

shop/default/shipping
shop/default/checkout

or if that's not possible this one:

shop/default/something/shipping
shop/default/something/checkout

How can I do this?

Re: Customize checkout urls

Posted: 25 Oct 2021, 11:08
by aimeos
niloofar wrote: 23 Oct 2021, 08:22 However, the URLs for each step are like this:

Code: Select all

/shop/default/checkout                              for shipping step
/shop/default/checkout/checkout                     for checkout step
But I want them to be:

shop/default/shipping
shop/default/checkout
That's difficult because the URL contains two parts:
- an unique route for Laravel
- an optional parameter for the checkout step ("shipping", "checkout", "process" in your case)

Your Laravel route is now "shop/{site}/checkout" and the optional parameter for the step will always be appended if present.
niloofar wrote: 23 Oct 2021, 08:22 or if that's not possible this one:

shop/default/something/shipping
shop/default/something/checkout
You can overwrite the Laravel checkout route in your ./routes/web.php e.g. to "shop/{site}/c/{c_step?} so the routes will be:

shop/default/c (if not c_step parameter is passed)
shop/default/c/shipping
shop/default/c/checkout

Here's the Laravel checkout route definition:
https://github.com/aimeos/aimeos-larave ... #L218-L221