Skip to main content

Posts

Showing posts from March 1, 2017

Get Attribute Value , type by attribute id

 $attribute = Mage::getModel('eav/entity_attribute')->load($attr); $type=$attribute->getFrontendInput(); $attrLabel=$attribute->getFrontendLabel(); $attrName=$attribute->getAttributeCode(); //echo $attribute->getData($attrName);die;  if($type=='multiselect'){ $html.='<div class="field"><label for='.$attrName.'"  class="required">'.$attrLabel.': </label><div class="input-box"><select multiple id="'.$attrName.'"  name="product['.$attrName.'][]" >'; //$values=$attribute->getSource()->getAllOptions(true, true); $values=$attribute->getAttributeText($attrName); $attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product',$attrName); $collection =Mage::getResourceModel('eav/entity_attribute_option_collection