price-view & checkout for registered user - extend Laravel registration

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
columbo
Posts: 3
Joined: 09 Oct 2019, 09:42

price-view & checkout for registered user - extend Laravel registration

Post by columbo » 09 Oct 2019, 10:02

Hi,

I'd like to restrict my Aimeos & Laravel 6 webshop, so that only registered and approved users can see products with prices and place orders. I expect, that I can use and extend the Laravel registration form for this.

When I use the Laravel (standard) registration form, siteId is not set (in user table) and the newly created customer / user can not be edited in Aimeos admin area ("read only").

How or where can I add the siteId? in config/shop.php?
Or do I have to add the siteId in registrationContoller?

Is there also a shop.php setting for restricting price-display and checkout for registered users only?

Thank you!

lucadambros
Posts: 44
Joined: 24 Jun 2019, 14:46

Re: price-view & checkout for registered user - extend Laravel registration

Post by lucadambros » 09 Oct 2019, 10:22

Use the middleware Authenticate.php and put the routes you want inside the web.php with this:

Code: Select all

Route::group(['middleware' => 'MIDDLEWARE THAT CHECKS IF USER IS LOGGED'], function ()
{
// list of the routes
}

lucadambros
Posts: 44
Joined: 24 Jun 2019, 14:46

Re: price-view & checkout for registered user - extend Laravel registration

Post by lucadambros » 09 Oct 2019, 10:29

All the routes can be found here: https://github.com/aimeos/aimeos-larave ... routes.php

You can match all the routes you want https://laravel.com/docs/master/routing ... p-prefixes without writing them all

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

Re: price-view & checkout for registered user - extend Laravel registration

Post by aimeos » 09 Oct 2019, 11:37

columbo wrote:
09 Oct 2019, 10:02
When I use the Laravel (standard) registration form, siteId is not set (in user table) and the newly created customer / user can not be edited in Aimeos admin area ("read only").

How or where can I add the siteId? in config/shop.php?
Or do I have to add the siteId in registrationContoller?
Yes, you have to set it in the registration controller.
columbo wrote:
09 Oct 2019, 10:02
Is there also a shop.php setting for restricting price-display and checkout for registered users only?
The Aimeos company is offering an extension for that:
https://aimeos.com/extensions#c437
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

columbo
Posts: 3
Joined: 09 Oct 2019, 09:42

Re: price-view & checkout for registered user - extend Laravel registration

Post by columbo » 09 Oct 2019, 11:49

aimeos wrote:
09 Oct 2019, 11:37
Yes, you have to set it in the registration controller.
Thank you!

are there any examples availbale how to add static values (like siteId) or add new viels (e.g. Company, Address, Phone, etc.) to the Laravel registartion form / registration controller?

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

Re: price-view & checkout for registered user - extend Laravel registration

Post by aimeos » 09 Oct 2019, 14:13

You should ask questions regarding the registration form in a Laravel forum.
The site depends on the "site" parameter in the URL (or "default" value if none is given) and you can get the site ID using:

Code: Select all

$context = $this->app->make('aimeos.context')->get();
$siteid = $context->getLocale()->getSiteId();
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply