顶部菜单中的 Opencart 3.0.2.0 和 Journal 3 主题客户名称

Opencart 3.0.2.0 and Journal 3 theme customer name in Top Menu

我想在 Journal 主题顶部菜单模块上添加客户的名字。我在 top-menu.twig 中添加 {{ text_logged }} 但它无法从控制器获取 text_logged。我怎样才能从 catalog/controller/common/header.php?

得到 text_logged
{% if logged %}
   {{ text_logged }}
{% endif %}

$data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/account', '', true), $this->customer->getFirstName(), $this->url->link('account/logout', '', true));

我想在 Journal 主题顶部菜单 $ US Dollar 上看到 "Hello John Do" 而不是

您需要使用 ocmod 或 vqmod 添加您的代码到 Journal 主题 common/header.tpl。我强烈建议不要因为可笑的缓存系统而更改 Journal 的核心代码(即使开发人员也无法摆脱它)。这里还有一个解决方案:You can edit this one for your purpose

我已经就期刊主题 v3 的同一问题联系了开发人员。他们告诉我可以用这个显示它:

Welcome back, {{ $customer_firstname }} {{ $customer_lastname }} !

在菜单项中显示客户的名字和姓氏。

我已将其集成到我的代码中,现在它会在登录时显示客户名称。无需编辑 OC MOD