Magento 首页显示更多的最新产品

Magento首页显示最新产品,后台CMS->Pages->Home page里有代码,只需要把注释去掉即可
,添加产品时记得设置Set Product as New from Date和Set Product as New to Date,添加产品后就可以在前台显示最新产品列表。

此外Magento默认显示条数是5条,如需修改在app\code\core\Mage\Catalog\Block\Product目录下打开new.php,找到“const DEFAULT_PRODUCTS_COUNT = 5;”,把默认的数字5修改为自己想要的数值。

相关代码如下:
<reference name="content"> <block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page"> <action method="addPriceBlockType"> <type>bundle</type> <block>bundle/catalog_product_price</block> <template>bundle/catalog/product/price.phtml</template></action></block> <block type="reports/product_viewed" name="home.reports.product.viewed" alias="product_viewed" template="reports/home_product_viewed.phtml" after="product_new"> <action method="addPriceBlockType"> <type>bundle</type> <block>bundle/catalog_product_price</block> <template>bundle/catalog/product/price.phtml</template></action></block> <block type="reports/product_compared" name="home.reports.product.compared" template="reports/home_product_compared.phtml" after="product_viewed"> <action method="addPriceBlockType"> <type>bundle</type> <block>bundle/catalog_product_price</block> <template>bundle/catalog/product/price.phtml</template></action></block> </reference> <reference name="right"> <action method="unsetChild"> <alias>right.reports.product.viewed</alias> </action> <action method="unsetChild"> <alias>right.reports.product.compared</alias> </action> </reference>

分享到:更多 ()

抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址