php - 显示名称姓 Magento 2.3.7(非会话)
问题描述
对于市场项目,我需要在他们的个人资料页面中显示卖家的姓名和姓氏。https://ibb.co/n8pfr0y
我已经有了这些信息,因为我在注册页面https://ibb.co/n8pfr0y询问卖家的姓名和姓氏,我可以在 MyAccount 页面中看到它们:https ://ibb.co/Tbr6fG3
现在查看姓名和姓氏的代码,我发现以下函数 /www/app/code/Magento/Customer/Block/Account/Dashboard/Info.php
* Get the full name of a customer
*
* @return string full name
*/
public function getName()
{
return $this->_helperView->getCustomerName($this->getCustomer());
}
以这种方式调用
<?= $block->escapeHtml($block->getName()) ?>
为什么如果我尝试在不同的 .phtml 页面 /www/app/code/Plugin/Marketplace/view/frontend/templates/seller/top-block.phtml 中使用上面的代码
不显示?
谢谢
解决方案
推荐阅读
- java - 尝试保存到 MySQL 日期时出现 JpaRepository SQL 语法错误
- javascript - 通过studentId字段过滤唯一学生对象的javascript不可变过滤器
- asp.net-core - 分布式 IdentityServer4 .net 核心(多实例)问题 HttpContext 不能为空
- java - 使用应用程序属性动态创建 bean
- android - 仅当所有内容都循环通过时,如何在循环中返回
- c# - .NET 核心 - 依赖注入、工厂和 IDisposable
- node.js - 使用 nodejs 直接在终端上运行 CD 命令
- python-3.x - 在python中使用标题名称提取特定列
- javascript - 使用 react-query 的依赖查询从两个数据源映射一个新数组
- c# - ASP.NET Core Razor 页面表单输入验证不起作用