Magento

Magento – Displaying Additional Product Attributes in Catalog List

Firstly I added new method to class Mage_Catalog_Block_Product_View_Attributes:

function setProduct($productId)
{
if (!Mage::registry('product') && $productId) {
$this->_product = Mage::getModel('catalog/product')->load($productId);
}
}

Then I’ve added to /app/design/frontend/*/*/template/catalog/product/list.phtml this:

<table class="info">
<?php
$add = new Mage_Catalog_Block_Product_View_Attributes();
$add->setProduct($_product->getId());
$_additional = $add->getAdditionalData();
?>
<?php foreach ($_additional as $_data): ?>
<tr>
<th><?php echo $_data['label'] ?></th>
<td><?php echo $_data['value'] ?></td>
</tr>
<?php endforeach; ?>
</table>

You Might Also Like