我想不出来了!
我试图在list.phtml页面上将产品属性列表放入一个数组中.我尝试了一切.我见过很多使用的解决方案
$attributes = $product->getAttributes();
Run Code Online (Sandbox Code Playgroud)
但我不能让它工作,它只是打开一个空白页面.任何帮助将不胜感激,到目前为止我花了几个小时和几个小时......
我使用的是Magento 1.4.2.0版
更新:这正是我想要做的:
$neededAttributes = Mage::helper('mymodule')->getNeededAttributes();
$attributes = $product->getAttributes();
foreach ($attributes as $attribute) {
if(in_array($attribute->getAttributeCode(), $neededAttributes)) {
$attributename = $attribute->getAttributeCode();
echo $attributename;
}
}
Run Code Online (Sandbox Code Playgroud)
这是在design/adminhtml/default/default/catalog/product/helper /中的gallery.phtml文件中
出于某种原因,我无法获取getAttributeCode函数来返回任何内容.
我试图从filter.phtml模板文件中获取属性代码.有没有人有任何想法如何做到这一点?