如何在Magento的产品列表模板页面上添加产品简短描述?

ase*_*106 4 magento magento-1.7

我想将产品简短描述添加到产品列表模板页面,我发现这篇文章:http: //www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-3-magento-controller-dispatch

它说:Blocks refer directly back to the models for their data. In other words, the Action Controller does not pass them a data structure. 那么,是否应该将简短描述的代码添加到Block类中?但Block类是Magento Core类: Mage_Catalog_Block_Product_List 我不应该编辑这个类,对吧?所以我该怎么做?创建我自己的Block类扩展Mage_Catalog_Block_Product_List并向其添加showProductShortDescription方法?如果是,我应该创建自己的模块吗?

谢谢!

Muf*_*dal 15

你可以在list.phtml文件中使用它.

$_product->getShortDescription();
Run Code Online (Sandbox Code Playgroud)

但Magento不会在产品列表页面上加载所有属性.转到管理面板目录 - >属性 - >管理属性并编辑简短描述属性.

将"用于产品列表"设置为"是".保存并清除缓存.