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

(Solved) Custom attribute - product->getAttributeText() problem on category page, but works on product details page
 
ChrisF
Member
 
Total Posts:  37
Joined:  2008-10-27
 

I put in a custom Free Shipping attribute.  So for the product details page (...\template\catalog\product\view.phtml) I can call $_product->getAttributeText(’free_shipping’) and it returns either ‘Yes’ or ‘No’ (it’s a drop down). 

But on the category page (...\template\catalog\product\view.phtml) making that call in the foreach($_productCollection as $_product) loop doesn’t work.  This http://www.magentocommerce.com/wiki/how-to/add-attributes-to-product-grid#update_templates page seems to say that calling getAttributeText on a product object should work.

Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ChrisF
Member
 
Total Posts:  37
Joined:  2008-10-27
 

In catalog.xml under layout/ I had forgot to add <action method="addAttribute"><name>free_shipping</name></action>
to <catalog_category_layered> in <block type="catalog/product_list"

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