Customize checkout urls
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Customize checkout urls
Hi.
I have changed checkout steps in the config like below:
I've created the necessary classes and everything works fine.
However, the URLs for each step are like this:
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?
I have changed checkout steps in the config like below:
Code: Select all
'html' => [
'checkout' => [
'subparts' => ['shipping', 'checkout', 'process']
]
]
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
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?
Aimeos version: ~2021.07
Laravel version: ^8.40
PHP: 7.4.9
Laravel version: ^8.40
PHP: 7.4.9
Re: Customize checkout urls
That's difficult because the URL contains two parts:niloofar wrote: ↑23 Oct 2021, 08:22 However, the URLs for each step are like this:But I want them to be:Code: Select all
/shop/default/checkout for shipping step /shop/default/checkout/checkout for checkout step
shop/default/shipping
shop/default/checkout
- 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.
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
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star