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 8926207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:54:46+00:00 2026-06-15T07:54:46+00:00

Hi i created a multi select product attribute with setup.php and it got created.

  • 0

Hi i created a multi select product attribute with setup.php and it got created. i used the following code:

 $installer = $this; 
 $installer->startSetup();   
 $installer->addAttribute('catalog_product', 'author_name',array( 
'label' => 'Name of The Author', 
'type' => 'varchar', 
'input' => 'multiselect', 
'backend' => 'eav/entity_attribute_backend_array', 
'frontend' => '', 
'source' => '', 
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 
'visible' => true, 
'required' => false, 
'user_defined' => false, 
'searchable' => false, 
'filterable' => false, 
'comparable' => false, 
'option' => array ( 'value' => array('optionone' => array('Carolyne Aarsen'), 
                                     'optiontwo' => array('Jennie Lucas'), 
                                     'optionthree' => array('Anna Adams'),
                                     'optionfour' => array('Kathryn Albright'), 
                                     'optionfive' => array('Trisha Alexander'), 
                                     'optionsix' => array('Vincent Alexandria'),
                                     'optionseven' => array('Louise Allen'), 
                                     'optioneight' => array('Abby Green'), 
                                     'optionnine' => array('Laura Abbot'),
                                     'optionten' => array('Caroline Anderson'), 
                                     'optioneleven' => array('Victoria Aldridge'), 
                                     'optiontwelve' => array('Harper Allen'),
                                     ) 
                  ), 
'visible_on_front' => false, 
'visible_in_advanced_search' => false, 
'unique' => false, 
'group' => 'General'
)); 
$installer->endSetup();

Then i want to get the author_name attribute value for each product in every category that is included in naigation menu of the site
i wrote the following query to get the attribute value:

    $categories = Mage::getModel('catalog/category')->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('include_in_menu', '1');
    foreach ($categories as $_category):
    if ($_category->getName() != 'Root Catalog'): 
     $category = Mage::getModel('catalog/category')->load($_category->getId());
     $products = $category->getProductCollection()
                       ->addCategoryFilter($category)
                       ->addAttributeToSelect('author_name')
                       ->setPageSize(9); 
         $author_names = array(); 
         foreach ($products as $_product):                             
        $author_names[] = $_product->getAttributeText('author_name');
         endforeach;
         print_r($author_names); 
    endif;
    endforeach; 

the array is not printing anything.
when i debug this i am not getting author_name attribute in the collection.

is there any thing wrong in my query.
please help me out

  • 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-06-15T07:54:48+00:00Added an answer on June 15, 2026 at 7:54 am

    Hello check following query may be help you

    get product id & using this id get product auther name

    $reqProdid = Mage::registry('current_product')->getId();
    $selected_auther =Mage::getModel('catalog/product')
        ->load($reqProdid)
        ->getData('author_name');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using this: Can I use Facebook's fb:friend-selector in an iframe? I created a multi-friend
I have a multi dimensional array, like this: array('name' => array('title'=>'Title','date'=>'Created')) I store it
I am using Eric Hynds’ jQuery for a multi-select list. I have created the
I have two query like this; SELECT j.ID, j.Pkey, j.SUMMARY, j.CREATED, j.RESOLUTIONDATE ,j2.SUMMARY, j2.CREATED,
Let me explain with example... Consider 'android.R.layout.simple_list_item_multiple_choice'. It used to create multi-select lists. But
I have created a multi-select list, input text box and a add button. User
I have a multi-step form (a wizard) that I created using this railscast: http://railscasts.com/episodes/217-multistep-forms
I have created a multi-instance performance counter and I pass it mixed case instance
I've created a multi-threaded service that uses Castle Windsor to create components to run
I have created an multi thread application on IIS (ASP.NET MVC), When the threading

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.