magento 首页添加最新产品 Display new product

系统 1922 0

方法一 : (widget)

 

This tutorial will show you how to add the new products block to the home page. All modifications would be done in Magento admin panel.  Open the admin panel, go to CMS> Pages>Home page .

 

Starting from Magento 1.4.0 you have the ability to use Magento widgets to display different content block within your pages. When you are in CMS> Pages>Home page, switch to the Content tab.

 

  1. At the top you can see the Insert Widget button. Click it.

    magento 首页添加最新产品 Display new products on the home page

  2. In the Widget type select box choose Catalog New Products List .
  3. Then you can select the number of the displayed products and the product listing template.
  4. When you are done click Insert Widget button.
  5. Click Save button at the top after the page customization is complete.

 

 

We recommend clear and disable the Magento cache when editing the static pages.

 

Feel free to check the detailed video tutorial below:

Magento. Display new products on the home page (widget)

 

 

来源: http://www.templatemonster.com/help/magento-display-new-products-on-the-home-page-widget.html


方法二 : (block)

 

This tutorial will show you how to display new products on the home page in Magento using the Magento block.

  • Open Magento admin panel
  • Go to CMS>Pages>Home page
  • Switch to the content tab
  • Insert the following code:

 

    {{block  type="catalog/product_new" column_count="6"  products_count="12" name="home.catalog.product.new"  alias="product_homepage"  template="catalog/product/list.phtml"}}
  
 

Where:

  • column_count="6" – number of the product columns
  • products_count="12" – number of the displayed products

 

来源: http://www.templatemonster.com/help/magento-display-new-products-on-the-home-page-block.html

 

方法三 : (XML)

 

This tutorial will show you how to display new products on the home page using the XML layout update.

 

Open Magento admin panel. Go to CMS>Pages>Home Page.   Switch to the Design tab. Into the Layout Update XML window paste the following code:

 

magento 首页添加最新产品 Display new products on the home page

 

 

1. First of all create the content reference:

          <reference  name="content">
</reference>
        
 

This will let you put the blocks into the home page content area.

 

2. Insert the new products block:

          <block  type="catalog/product_new" name="product_new"  template="catalog/product/list.phtml">
</block>
        
 

The block code should be inserted into the reference tag.

 

3. Set the number of the product columns in the new products listing:

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

The action code should be inserted into the block  tag.

 

4. Set the amount of products displayed in the new products block:

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

As a result your XML code should look like this:

          <reference  name="content">
<block  type="catalog/product_new" name="product_new"  template="catalog/product/list.phtml">
<action  method="setColumnCount"><column_count>6</column_count></action>
<action  method="setProductsCount"><count>0</count></action>
</block>
</reference>
        
 

In case you want to display the new products from the specific category use the following action:

          <action  method="setCategoryId"><category_id>10</category_id></action>
        
 

Make sure you set the correct category ID value. You can get the category ID from the admin panel> Catalog>Manage categories .

 

We recommend clear and disable the Magento cache when editing the static pages.

 

来源: http://www.templatemonster.com/help/magento-display-new-products-on-the-home-page-xml.html

 

magento 首页添加最新产品 Display new products on the home page


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论