获取Opencart中当前用户的信息
我一直在使用Opencart开发一个模块,我想知道如何获取当前的用户信息 我的想法是这样的:获取Opencart中当前用户的信息,opencart,Opencart,我一直在使用Opencart开发一个模块,我想知道如何获取当前的用户信息 我的想法是这样的:$this->getuserid()我刚刚发现: $this->customer->getFirstName(); $this->customer->getLastName(); $this->customer->getEmail(); $this->customer->getTelephone(); $this->customer->getFa
$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文件获取
谢谢 没错!我在搜索用户,在这么多帖子中,答案都是针对客户的,这让人困惑。谢谢你的帮助。