Make login require for checkout the order

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Dhara1510
Posts: 15
Joined: 27 Apr 2019, 05:36

Make login require for checkout the order

Post by Dhara1510 » 17 May 2019, 13:23

I want a user to login before checkout the order.

Current scenario: User can add product to cart and do checkout without login

Required scenario: User can add product to cart. User has to login when he want to do checkout. When user click on it should redirect user to login page.

How can it be done? Can you please guide me?

AnthonyLim
Posts: 6
Joined: 17 May 2019, 09:02

Re: Make login require for checkout the order

Post by AnthonyLim » 17 May 2019, 16:05

Not exactly what you ask for, but what I did was to make the user login even before shopping. It's pretty easy; just edit config/shop.php and configure the "routes" like so:

Code: Select all

'routes' => [
      'default' => ['prefix' => 'shop', 'middleware' => ['web','auth']],
],

Dhara1510
Posts: 15
Joined: 27 Apr 2019, 05:36

Re: Make login require for checkout the order

Post by Dhara1510 » 20 May 2019, 05:59

Thanks. I have overridden routes and applied "auth" middleware to checkout controller and it works :)

Post Reply