Tuesday, 2 February 2016
Magento – get Attribute details by attribute code
magento attribute is a very important part of the catalog structure. Many a time we need to get some other details of the attribute, for example frontend label or attribute id or the attribute frontend type.
This code returns all the details of the product attribute using the attribute code
$attribute_attributecode = "attributecode";
$attribute_details = Mage::getSingleton("eav/config")->getAttribute("catalog_product", $attribute_utpftp);
$options_attributecode = $attribute_details->getSource()->getAllOptions(false);
$attribute = $attribute_details->getData();
$label_attributecode =$attribute['frontend_label'];
$input_attributecode =$attribute['frontend_input'];
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment