Permit checkout only for authenticated uers/Ask login before check out step

How to configure and adapt Aimeos based shops as developer
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!
unnimaya-seeroo
Posts: 10
Joined: 20 Jun 2023, 07:00

Permit checkout only for authenticated uers/Ask login before check out step

Post by unnimaya-seeroo » 02 Nov 2023, 04:19

Environment : Laravel 10, aimeos 2023.04

How can we check login before the checkout step, we need to permit checkout only for authenticated uers.
We found an article which says to manage in config/shop.php like
'default' => ['prefix' => $prefix . 'shop', 'middleware' => ['web','auth']]
But this will ask login from shop page itself , we need the same only before checkout page.
Please advice.

Thanks

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Permit checkout only for authenticated uers/Ask login before check out step

Post by aimeos » 02 Nov 2023, 07:15

Please upgrade to 2023.10 LTS as previous 2023.x versions are not supported any more!

In 2024.x+, basket and checkout routes will be in separately configurable route groups:
https://github.com/aimeos/aimeos-larave ... #L225-L248

A solution for 2023.10 is copy the routes from the default route group to your ./routes/web.php file and add "auth" middleware to the "aimeos_shop_checkout" route:
https://github.com/aimeos/aimeos-larave ... #L225-L275

Then, disable the original route by setting this config in your ./config/shop.php to FALSE:
https://github.com/aimeos/aimeos-larave ... op.php#L22
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply