在Prestashop中获取客户id\u默认\u组
我需要检查TPL文件中的客户id \默认\组 像 但是这个代码在Prestashop中获取客户id\u默认\u组,prestashop,Prestashop,我需要检查TPL文件中的客户id \默认\组 像 但是这个代码 {$cookie->id_default_group} 不行 客户登录时如何获取ID组?php 试试这个 $this->context->customer->id_default_group; // your variable to be used 或 .tpl 如果要在.tpl中使用它,首先需要将变量传递到模板文件中,然后在php中编写 $this->context->smarty->
{$cookie->id_default_group}
不行
客户登录时如何获取ID组?php
试试这个
$this->context->customer->id_default_group; // your variable to be used
或
.tpl
如果要在.tpl
中使用它,首先需要将变量传递到模板文件中,然后在php
中编写
$this->context->smarty->assign(array(
'customer' => $this->context->customer
));
然后在.tpl
{if isset($customer->id_default_group)}
{$customer->id_default_group|intval}
{/if}
php
试试这个
$this->context->customer->id_default_group; // your variable to be used
或
.tpl
如果要在.tpl
中使用它,首先需要将变量传递到模板文件中,然后在php
中编写
$this->context->smarty->assign(array(
'customer' => $this->context->customer
));
然后在.tpl
{if isset($customer->id_default_group)}
{$customer->id_default_group|intval}
{/if}
在PS 1.6.15中,我使用
{Group::getCurrent()->id}
也许这也适用于您。在PS 1.6.15中,我使用
{Group::getCurrent()->id}
也许这也适用于您。我想在TPL文件中使用。。像{$cookie->customer_firstname}我想在TPL文件中使用。。比如{$cookie->customer_firstname}