Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
获取Opencart中当前用户的信息_Opencart - Fatal编程技术网

获取Opencart中当前用户的信息

获取Opencart中当前用户的信息,opencart,Opencart,我一直在使用Opencart开发一个模块,我想知道如何获取当前的用户信息 我的想法是这样的:$this->getuserid()我刚刚发现: $this->customer->getFirstName(); $this->customer->getLastName(); $this->customer->getEmail(); $this->customer->getTelephone(); $this->customer->getFa

我一直在使用Opencart开发一个模块,我想知道如何获取当前的用户信息

我的想法是这样的:
$this->getuserid()

我刚刚发现:

$this->customer->getFirstName();
$this->customer->getLastName();
$this->customer->getEmail();
$this->customer->getTelephone();
$this->customer->getFax();
等等

源代码(包括其他可用方法)位于该文件中

你可以在任何地方使用这些方法


希望这有帮助。

客户和用户之间存在差异。要获取当前用户ID(管理员、经理等),请执行以下操作:

$this->session->data['user_id'];

获取当前登录用户id的另一种方法

$this->user->getId();
在oc3中

您可以在中获取库文件夹

your_project/system/library/cart/customer.php
在customer.php文件中,您将获得所有函数,可以在其中调用控制器并将其签出

$this->customer->getId();
获取您的客户id等,您可以从customer.php文件获取


谢谢

没错!我在搜索用户,在这么多帖子中,答案都是针对客户的,这让人困惑。谢谢你的帮助。