I cannot figure this out!
I am trying to get a list of a products attributes into an array on the list.phtml page. I have tried everything. I have seen a lot of solutions that use
$attributes = $product->getAttributes();
but I cannot get this to work, it just brings up a blank page. Any help would be greatly appreciated, I have spent hours and hours on this so far...
I am using Magento version 1.4.2.0
UPDATE: Here is exactly what I am trying to do:
$neededAttributes = Mage::helper('mymodule')->getNeededAttributes();
$attributes = $product->getAttributes();
foreach ($attributes as $attribute) {
if(in_array($attribute->getAttributeCode(), $neededAttributes)) {
$attributename = $attribute->getAttributeCode();
echo $attributename;
}
}
this is in the file gallery.phtml in design/adminhtml/default/default/catalog/product/helper/
For some reason, I cannot get the getAttributeCode function to return anything.