Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7522447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:31:31+00:00 2026-05-30T02:31:31+00:00

How to get attributes and its values using single Collection in Magento? Right now

  • 0

How to get attributes and its values using single Collection in Magento?
Right now i am using below

$attributesInfo = Mage::getResourceModel('eav/entity_attribute_collection')
                  ->setEntityTypeFilter(4)
                  ->addFieldToFilter('frontend_input','multiselect')
                  ->addSetInfo()
                  ->getData(); 

to get attribute and below code to get attribute value


$product = Mage::getModel('catalog/product');
$collection = Mage::getResourceModel('eav/entity_attribute_collection')
                ->setEntityTypeFilter($product->getResource()->getTypeId())
                ->addFieldToFilter('attribute_code', $attributeName);

My attributes code out put is like below

 
  Color :
   Black
   Blue
   Green

 Brand :
   Hp
   Dell
   Apple

 Size :
  12
  14
  16

 

Thanks,

Balan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:31:32+00:00Added an answer on May 30, 2026 at 2:31 am

    How about this:

    $attributes = Mage::getSingleton('eav/config')
        ->getEntityType(Mage_Catalog_Model_Product::ENTITY)
        ->getAttributeCollection()
        ->addFieldToFilter('source_model', array('notnull' => true))
        ->addSetInfo();
    
    foreach ($attributes as $attribute)
    {
        echo "{$attribute->getFrontendLabel()}:\n";
        foreach ($attribute->getSource()->getAllOptions() as $option)
        {
            echo "  {$option['label']}\n";
        }
        echo "\n";
    }
    

    By using the eav/config and eav/entity_type chances are you will be reusing an already loaded collection, which of course is more efficient then reloading the same data in new collections.

    EDIT: Updated the answer to include the attribute collection filter suggested by Aleksandr Ryabov.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Where does glibc get its database of unicode attributes, for such functions as eg,
I am using xpath in java. I want to get all the attributes (name
I want to get a files these attributes as integer values.
How do you set/get the values of attributes of t given by x ?
I want to get values and attributes from a selector and then get attributes
How to check element existence using its alias attributes with Mootools Tried as follows.
Is there any way to get the custom attributes of a specific object I
MVC use action attributes to map the same view for http get or post:
I am trying to get all of the video elements and their attributes from
I've been trying to get the UNIQUE constraint placed on some attributes I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.