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

How to get all values for an attribute
 
Andrew Tch
Jr. Member
 
Total Posts:  2
Joined:  2008-04-18
 

Hello, developers of magento the greatest!
I’ve created new attribute (internal_type), and, in catalog -> Manage Products i want to add a filter based on this attribute value (this is drop-down box).

So, I go to app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php

I add the following lines of code:

$this->addColumn('internal_type',
            array(
                
'header'=> Mage::helper('catalog')->__('Internal type'),
                
'width' => '100px',
                
'index' => 'internal_type',
                
'type'  => 'options',
                
'options' => $some_list_of_internal_types,
        ));

but… how do I get all values for an attribute ‘internal_type’? Something like:

$internal_types Mage::getResourceModel('eav/entity_attribute_option_collection')
                ->
setAttributeFilter(571)
                ->
setPositionOrder('desc')
                ->
load()
                ->
toOptionHash();

doesn’t work (571) id my attribute’s id. Could you give a brief direction where to go? Thank you in advance! I’m not strong in Zend, I mostly use symfony in my projects.

 
Magento Community Magento Community
Magento Community
Magento Community
 
rangnath
Jr. Member
 
Total Posts:  7
Joined:  2013-12-12
 

Hello,

I have got the solution on this website must read Get All The Values Of a Attribute In Magento.
Or you can read here Expertwebadvisor.

Thanks

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