如何在 Magento 中使用类别标题而不是类别名称?
-
13-12-2019 - |
题
后端有一个名为“类别标题”的字段,我想使用它来代替“视图”下的“类别名称”。当前的代码就像
<h1 class="cate"><?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?></h1>
请指导我如何获取它。另外,所有这些东西都有简单的文档吗?
解决方案
如果你指的是类别标题,你可以这样得到:
echo $_helper->categoryAttribute($_category, $_category->getMetaTitle(), 'meta_title');
如果有自定义字段类别标题,请执行以下操作:
Mage::log(print_r($_category->debug(), true), null, 'category.log', true);
然后去 var/log/category.log
您会在那里找到您需要的所有信息。