0

I have module in Prestashop, where I need the current customer id. Here is my code in module php file:

$userid =(int)$this->context->customer->id;
$this->context->smarty->assign('userid',$userid);

I use this variable like parameter for custom link. This work fine, but every time get same ID. I mean...for different users. What could be the reason for this?

4

1 回答 1

0

您可能应该尝试:

$id = (int)$this->context->cookie->id_customer;
于 2014-06-01T12:10:28.547 回答