суббота, 10 марта 2012 г.

Magento cms home page with products and pager

Params:
Magento 1.6.0

Problem:
Display products on home page with pager.

Solution:
Without programming you can display products only from one category.
Edit home page in admin panel of your shop.
Admin panel -> CMS -> Pages -> Home page
Insert into "Design" tab the following code
<reference name="content">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
   <action method="setCategoryId">
      <category_id>18</category_id>
   </action>
   <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
      <block type="page/html_pager" name="product_list_toolbar_pager"/>
   </block>
   <action method="setToolbarBlockName">
      <name>product_list_toolbar</name>
   </action>
</block>
</reference>
Change the category_id value for your needs.