I have been work on a module with Opencart and I was wondering how I can get current user information.
I was thinking something like this: $this->getuserid();
I have been work on a module with Opencart and I was wondering how I can get current user information.
I was thinking something like this: $this->getuserid();
I just found it out:
$this->customer->getFirstName();
$this->customer->getLastName();
$this->customer->getEmail();
$this->customer->getTelephone();
$this->customer->getFax();
and so on.
The source code (including the other methods available) is located in the system/library/customer.php
file.
You can use the methods just anywhere.
Hope this helps.
There is difference between customer and user. To get current user ID (admin, manager etc) do the following:
$this->session->data['user_id'];
Another way to get the id of the user that is currently logged in
$this->user->getId();
In oc3
You can get the library folder in
your_project/system/library/cart/customer.php
In the customer.php file, you will get all the functions where you can call in your controller and check it out.
$this->customer->getId();
Get your customer id and etc etc you can get it from the customer.php file.
Thanks.
© 2022 - 2024 — McMap. All rights reserved.