display product label and custom option in magento listing page

 <?php $attr = $_product->getResource()->getAttribute("unit_packaging");
if ($attr->usesSource()) {
    echo $color_id = $attr->getSource()->getOptionText($_product->getUnitPackaging());
}
 ?>

Comments

  1. where to add this code? in list.phtml?

    ReplyDelete
    Replies
    1. you can put this code to any file for example unit_packaging attribute you want to display in product view page so you have to put anywhere whenever you want to display in view page same for list page
      please replace your attribute name on the place of (;unit_packaging')

      Thanks!

      Delete

Post a Comment

Feel Free To Ask...