且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Magento:在主页上显示新产品

更新时间:2023-11-30 12:34:04

首先,转到"CMS">页面">选择主页"(URL键:home). 点击设计" 将以下XML更新粘贴到提供的字段中:

First, go to "CMS" > "Pages" > select "Home Page" (URL Key: home). Click on "Design" Paste the following XML update into the field provided:

<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>
<action method="setColumnCount"><columns>4</columns></action>
<action method="setProductsCount"><count>4</count></action> 
</block>
</reference>

如果您想增加/减少每列的产品数量,请更改

If you would like to increase/decrease the amount of products per column, please change

<action method="setColumnCount"><columns>4</columns></action>

 <action method="setColumnCount"><columns>6</columns></action>

此外,如果您想限制显示的产品数量,请更改

Also if you would like to limit the amount of products shown, change

<action method="setProductsCount"><count>4</count></action>

<action method="setProductsCount"><count>3</count></action>

请注意:要使产品显示在首页上,您必须通过在常规"标签中设置将产品设置为新的日期"和将产品设置为新的日期"选项,确保已将产品标记为新产品.

Please note: For the products to show on the homepage you MUST ensure you have marked the products as new by setting "Set Product as New from Date" and "Set Product as New to Date" options in the "General" tab.