Monday, 25 August 2014

Get product attribute’s select option id/label/value in magento


$productModel = Mage::getModel('catalog/product');
$attr = $productModel->getResource()->getAttribute("color");
 echo $color_id = $attr->getSource()->getOptionId("Red");

No comments:

Post a Comment