Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Attribute options
 
nostrzak
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2007-09-18
Wroclaw, Poland
 

Hi,

I want to fetch all product attribute options. So far I managed to get attribute with:

$attribute Mage::getModel('catalog/entity_attribute');
$attribute->load(55);

How can I fetch it’s attributes?

 
Magento Community Magento Community
Magento Community
Magento Community
 
John
Sr. Member
 
Avatar
Total Posts:  129
Joined:  2007-12-20
Sheffield, United Kingdom
 

Hi, if you want to focus on the attributes of a product then you can use the method : $product->getAttributes()

Is that what you where looking for?

John

 
Magento Community Magento Community
Magento Community
Magento Community
 
somesid
Sr. Member
 
Total Posts:  83
Joined:  2008-06-20
 

If you need every attribute from an attribute set, it should be like this :

$attributes Mage::getResourceModel('eav/entity_attribute_collection')
                    ->
setAttributeSetFilter($attributeSetId)
                    ->
load();

You can look /app/code/core/Mage/CatalogSearch/Model/Advanced.php to see some code handling attributes with their data.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top