Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.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
在Prestashop中获取客户id\u默认\u组_Prestashop - Fatal编程技术网

在Prestashop中获取客户id\u默认\u组

在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->

我需要检查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->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}