显示Magento类别图像
通常,顶部菜单会列出子类别的名称,我想列出子类别的图像。任何人都可以建议php代码显示Magento类别图像,magento,magento-1.4,Magento,Magento 1.4,通常,顶部菜单会列出子类别的名称,我想列出子类别的图像。任何人都可以建议php代码 谢谢可以通过config.xml将其他属性添加到前端类别属性加载列表中: <frontend> <category> <collection> <attributes> <[attribute_code] /> </attributes>
谢谢可以通过config.xml将其他属性添加到前端类别属性加载列表中:
<frontend>
<category>
<collection>
<attributes>
<[attribute_code] />
</attributes>
</collection>
</category>
</frontend>
只需将[attribute\u code]
替换为图像属性代码(在您的情况下可能是图像
)
然后,您可以通过$category->getImage()
访问类别图像,也可能需要覆盖Mage\u Catalog\u Block\u导航
Block以自定义菜单的html格式
完成此自定义后,请不要忘记清理缓存并重建平面类别索引(如果已使用)。对不起,我不知道您的意思。您知道检索目录和子目录的php代码在哪里吗?Mage_Catalog_Block_导航它在这里,但是您需要为此创建新模块,而不是修改现有代码。