I am using Magento 1.9.3.6 version. I have an attribute called brand. I want to get brand attribute's values collection by filter in order to show it in input text box as autocomplete suggestions.
I have tried the following code:
$attributeId = Mage::getResourceModel("eav/entity_attribute")->getIdByCode("catalog_product","brand"); $attribute = Mage::getModel("catalog/resource_eav_attribute")->load($attributeId); $attributeOptions = $attribute ->getSource()->getAllOptions(); I get this output in autocomplete input box:
When I tried like this,
$attributeOptions = $attribute ->getSource()->getAllOptions()->addAttributeToFilter("value", "brand"); it shows error.
Fatal error: Call to a member function addAttributeToFilter() on array in .../CustomController.php on line 52
How to get attribute values as array filter by brand values.

