客户登录Opencart 3后如何在标题中显示客户名称

时间:2019-01-27 14:48:00

标签: opencart

我尝试了这个,但是没有用。

控制器catalog/controller/common/header.php

查找:return $this->load->view('common/header', $data);

在其之前添加:

if($this->customer->isLogged()){
    $data['text_customer_name'] = sprintf($this->language->get('text_customer_name'), $this->customer->getFirstName(), $this->customer->getLastName());
} else {
    $data['text_customer_name'] = $this->language->get('text_account');
}

语言

catalog/language/*/common/header.php

添加:

$_['text_customer_name'] = 'Hi %s %s';

查看

catalog/view/theme/*/template/common/header.twig

查找:

{{ text_account }}
Replace with: {{ text_customer_name }}

0 个答案:

没有答案