Login/Register forms within shop pages

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
snicto
Posts: 37
Joined: 12 Oct 2022, 14:00

Login/Register forms within shop pages

Post by snicto » 07 Dec 2022, 15:23

Laravel: 9
Aimeos: 2022.10

I need an extra step before the checkout address step which would be a push for people to register or log in. So this page should display a login form and a link to the registration page. Is it possible to achieve such implementation of auth object within the shop itself?

If not, can you style login/register pages to be the same as shop pages, that is to reuse such elements as CSS, headers, footers, etc?

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

Re: Login/Register forms within shop pages

Post by aimeos » 08 Dec 2022, 15:56

First, you need to disable the Aimeos default routes:
https://github.com/aimeos/aimeos-larave ... #L212-L267
Set the "default" to false here:
https://github.com/aimeos/aimeos-larave ... op.php#L19

Then, copy the complete "default" route group to your ./routes/web.php. Move the checkout route to it's own route group and add 'auth' as middleware for the checkout route:

Code: Select all

	Route::group( ['prefix' => 'shop', 'middleware' => ['auth', 'web'], function() {

		Route::match( array( 'GET', 'POST' ), 'checkout/{c_step?}', array(
			'as' => 'aimeos_shop_checkout',
			'uses' => 'Aimeos\Shop\Controller\CheckoutController@indexAction'
		) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] );
	});
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply