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 do I get a specific product attribute? 
 
Shpigford
Sr. Member
 
Avatar
Total Posts:  171
Joined:  2007-09-03
Denver, CO
 

I have an “artist” attribute (similar to Manufacturer) that I’d like to display on category and product pages. How can I do that?

I’ve tried this but nothing shows up:

<?php echo $_product->getAttributeText('artist')?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
dan_w
Sr. Member
 
Total Posts:  290
Joined:  2008-01-04
 

If I remember correctly, getAttributeText() is used for dropdown type attributes. If artist attribute is not a dropdown, you may want to try

<?php echo $_product->getArtist()?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Shpigford
Sr. Member
 
Avatar
Total Posts:  171
Joined:  2007-09-03
Denver, CO
 
dan_w - 07 June 2008 09:24 AM

If I remember correctly, getAttributeText() is used for dropdown type attributes. If artist attribute is not a dropdown, you may want to try

<?php echo $_product->getArtist()?>

“artist” is indeed a dropdown. I also just tried getArtist() for good measure and it’s a no-go as well.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cutemonster
Jr. Member
 
Total Posts:  11
Joined:  2008-07-07
 

does anyone figure this out yet?
I also need to know.

plus, which file I should modify for attribute block?

regards,

 
Magento Community Magento Community
Magento Community
Magento Community
 
Chris Wiech
Jr. Member
 
Total Posts:  11
Joined:  2008-07-11
 

This part of code really works:

<?php echo $_product->getArtist()?>

I tried by myself and with the documentation to find out which part of the code does this job. I’m interesed in, because the method is nowhere declared and I want to understand how is works.

Can someone give me hint for this?

Thanks,
Chris

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