Saturday, November 21, 2009

Show description in the product list page (for Vania)

This is an answer for 
http://www.magentocommerce.com/boards/viewthread/67466/
Problem: Show the product long description on the list page.
Hi Vania. You can use in the list.phtml file this.
$_product->getDescription(); 
[UPDATE] For Magento versions that support WYSIWYG editors this is the correct way to display the description:
<?php echo $this->helper('catalog/output')->productAttribute($_product, $_product->getDescription(), 'description') ?>
[/UPDATE]
but Magento does not load all the attributes on the product listing page. Go to the admin pannel Catalod->Attributes-> Manage Attributes and edit the description attribute. Set "Used in product listing" to "Yes". Save and clear the cache.

7 comments:

  1. Thanks it's working fine :)
    Amit

    ReplyDelete
  2. "Catalod->Attributes-> Manage Attributes and edit the description attribute. Set "Used in product listing" to "Yes". Save and clear the cache. " => Very Useful :). Thanks!!!

    ReplyDelete
  3. Thank you so much!

    I made a new attribute and made that show up on the product list! :)

    ReplyDelete
  4. Very useful, thanks a lot! :-)

    ReplyDelete
  5. But when i add image then it not appear..
    can you assist me,,

    ReplyDelete
    Replies
    1. When I wrote this post Magento did not have WYSIWYG editor. I think this should resolve your problem:
      helper('catalog/output')->productAttribute($_product, $_product->getDescription(), 'description') ?>

      I will update the post also.
      Marius.

      Delete