1

i would like to know how to get the frond end properties in magento because in the resource model that i got these properties are not available, i dont know why or how to get them, this is the collection that i got:

        $collection = Mage::getResourceModel('eav/entity_attribute_collection');

but if i try to get any front end property doesnot give anything:

  foreach($collection as $attribute){         
        Mage::log($attribute->getIsSearchable(),null,"layerfilter.log");
   }

Output: 2014-06-23T21:44:48+00:00 DEBUG (7):

1
  • Try $collection = Mage::getModel('eav/entity_attribute')->getCollection(); instead.
    – Niloct
    Commented Jun 23, 2014 at 22:52

2 Answers 2

0

After getting collection of all attributes, you should load each attribute individually by its attribute code then it will give you the front-end properties of respective attribute

<pre>
$attribute_code = "manufacturer"; 
$attribute_details = Mage::getSingleton("eav/config")->getAttribute("catalog_product", $attribute_code); 
$options = $attribute_details->getSource()->getAllOptions(false);
echo $attribute_details->getIsSearchable(); 
</pre>

here we loaded 'manufacturer' attribute by passing its code. Here, It is returning its options and print 1 or 0 by getIsSearchable() .

1

I assume, this is what you need:

$attribute_code = "name"; 
$attribute_details =
Mage::getSingleton("eav/config")->getAttribute('catalog_product',    $attribute_code);
$attribute = $attribute_details->getData();
print_r($attribute);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.