How to get Prestashop current user id?
问题 I used the below code to try to get the current user ID in prestashop.. am placing this code in another php file in my module directory and call it through by the module file. $id = $this->context->customer->id_customer; but its not working for me.. am using prestashop 1.5 .. 回答1: I certainly couldn't get it to work in my test either. However, you can try $id = (int)$this->context->cookie->id_customer; which works for me. I'm not at all sure that this is the best way to do it though. 回答2: