Monday, 21 October 2013

show attribute label and its value or Id in magento

<table>
<tr><td>label</td>
<td>value</td>
</tr>
<?php
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'manufacturer');
foreach ($attribute->getSource()->getAllOptions(true, true) as $instance) {
?>
<tr>
<td><?php echo $instance['label']; ?></td>
<td><?php echo $instance['value']; ?></td>
</tr>
<?php
}
?>
</table>

No comments:

Post a Comment