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 display a custom attribute in a search result listing? 
 
jjeff
Member
 
Total Posts:  68
Joined:  2009-03-20
Central New York
 

I have placed a product attribute (Author) into my category listing pages for both grid and list view.
See: http://72.167.34.59/new-this-week.html

The code I used was placed in app/design/../layout/catalog.xml. The action method below was placed directly below the block tag in both grid and list view.

<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<action method="addAttribute"><attribute>Author</attribute></action>

Then in app/design/../template/catalog/product/list.phtml I placed the following:
<?php echo $_product->getAttributeText('Author') ?>

This allowed me to add a custom attribute to the listing page. But now, when I use the search bar in the header I don’t get the Author field to display.

See: http://72.167.34.59/index.php/catalogsearch/result/?q=card&x;=24&y;=8

Anyone have any ideas?

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