Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add product short description on the product list template page on Magento?

I want to add product short description to product list template page, and I found this article: http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-3-magento-controller-dispatch

it said: Blocks refer directly back to the models for their data. In other words, the Action Controller does not pass them a data structure. So , does it mean the code to get short description should be added to the Block class? But the Block class is Magento Core class: Mage_Catalog_Block_Product_List I should not edit this class, right? So what should I do? Create my own Block class extend Mage_Catalog_Block_Product_List and add the showProductShortDescription method to it? If yes, Should I create my own module?

Thank you!

like image 256
aserww106 Avatar asked Jul 31 '13 00:07

aserww106


1 Answers

You can use in the list.phtml file this.

$_product->getShortDescription();

but Magento does not load all the attributes on the product listing page. Go to the admin pannel Catalog->Attributes-> Manage Attributes and edit the short description attribute.

Set “Used in product listing” to “Yes”. Save and clear the cache.

like image 73
Mufaddal Avatar answered Nov 06 '22 09:11

Mufaddal