Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 2 characters in body; edited title
Source Link
Piyush
  • 5.9k
  • 9
  • 35
  • 67

Magneto Magento Get Attribute values Collection by filter

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 inorder roin order to show it in input text box as autocomplete suggestionsuggestions.

brand attribute

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:

auto complete

When iI 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.

Magneto Get Attribute values Collection by filter

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 inorder ro show it in input text box as autocomplete suggestion.

brand attribute

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:

auto complete

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.

Magento Get Attribute values Collection by filter

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.

brand attribute

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:

auto complete

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.

format the error
Source Link
Manashvi Birla
  • 8.9k
  • 9
  • 29
  • 53

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 inorder ro show it in input text box as autocomplete suggestion.

brand attribute

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:

auto complete

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

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.

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 inorder ro show it in input text box as autocomplete suggestion.

brand attribute

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:

auto complete

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.

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 inorder ro show it in input text box as autocomplete suggestion.

brand attribute

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:

auto complete

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.

added 399 characters in body
Source Link
Saravanan DS
  • 1.1k
  • 1
  • 18
  • 46

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 inorder ro show it in input text box as autocomplete suggestion.

[![brand attribute][1]][1]brand attribute

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:

auto complete

When i tried like this,

 $attributeOptions = $attribute ->getSource()->getAllOptions()->addAttributeToFilter("value", "brand"); 

But 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. [1]: https://i.sstatic.net/zd9rA.png

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.

[![brand attribute][1]][1]

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()->addAttributeToFilter("value", "brand"); 

But it shows error.

How to get attribute values as array filter by brand values. [1]: https://i.sstatic.net/zd9rA.png

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 inorder ro show it in input text box as autocomplete suggestion.

brand attribute

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:

auto complete

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.

Source Link
Saravanan DS
  • 1.1k
  • 1
  • 18
  • 46
Loading