Get info about current user in Opencart

user1438910 picture user1438910 · Oct 30, 2012 · Viewed 20.3k times · Source

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();

Answer

user1438910 picture user1438910 · Oct 30, 2012

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.