$_product = $this->getProduct();
$gridattributes = array();
$attributes = $_product->getAttributes();
foreach ($attributes as $attribute) {
if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), $excludeAttr)) {
$value = $attribute->getFrontend()->getValue($_product);
if (!$_product->hasData($attribute->getAttributeCode())) {
$value = Mage::helper('catalog')->__('N/A');
} elseif ((string)$value == '') {
$value = Mage::helper('catalog')->__('No');
} elseif ($attribute->getFrontendInput() == 'price' && is_string($value)) {
$value = Mage::app()->getStore()->convertPrice($value, true);
}
if (is_string($value) && strlen($value)) {
$gridattributes[$attribute->getAttributeCode()] = array(
'label' => $attribute->getStoreLabel(),
'value' => $value,
'code' => $attribute->getAttributeCode()
);
}
}
}
?>
<th><?php echo $this->__('Product Name') ?></th>:
foreach($gridattributes as $attrib){
echo '<th>'.$this->htmlEscape($attrib[label]).'</th>';
}
<td><?php echo $this->htmlEscape($_item->getName()) ?></td>:
foreach($gridattributes as $attribname=>$attribval){
echo '<td>'.$this->htmlEscape($_item->getData($attribname)).'</td>';
}