Aimeos order Customer ID

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!
wassim.hattab
Posts: 20
Joined: 13 Jul 2016, 08:03

Aimeos order Customer ID

Post by wassim.hattab » 20 Sep 2016, 14:05

Hello,
i'm facing a problem with aimeos orders,
i'm building a multishop website with aimeos laravel and asgard..
I have a sign in in the front end i used the same function as asgard.. but the problem im facing that when i logged in and order an item or something, the customer id in 'mshop_order_base' is null where can i modify the query to use the id of the logged in user or an id session ?? :shock: :shock: :?: :!:

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

Re: Aimeos order Customer ID

Post by aimeos » 20 Sep 2016, 14:17

Does Asgard use another table for storing registered users than the Laravel "users" table?
What you describe looks like that the Laravel Auth facade doesn't know that the user is logged in:
https://github.com/aimeos/aimeos-larave ... t.php#L123
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

wassim.hattab
Posts: 20
Joined: 13 Jul 2016, 08:03

Re: Aimeos order Customer ID

Post by wassim.hattab » 20 Sep 2016, 14:30

aimeos wrote:Does Asgard use another table for storing registered users than the Laravel "users" table?
Asgard uses the same table users

And yes the Auth::id() is null in my case because i'm using a different authentication than laravel how can i fix this problem or you recommend to use the authentication of larabel?

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

Re: Aimeos order Customer ID

Post by aimeos » 20 Sep 2016, 15:38

Use the dev-master branch, there you can overwrite the bootstrapping easier and
- Create a new class with extends from the class \Aimeos\Shop\Base\Context
- Overwrite the addUser() method with your own one
- Register your new class using the name "\Aimeos\Shop\Base\Context" in the ./app/Provider/AppServiceProvider.php class of your application ( see https://github.com/aimeos/aimeos-larave ... er.php#L95)
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply