All about Magento E-commerce Store.......MagentoForum: Magento: Display products from the category on the home page

Thursday, July 7, 2011

Magento: Display products from the category on the home page

This tutorial will show you how to add products from the specific category to the Magento home page.

 

Get category ID

  1. Open Magento admin panel and go to Catalog > Manage Categories.
  2. Select the necessary category and look for the category ID at the top.

Remember the category ID value as you'll need it later.

 

Create products block

  1. In Magento admin panel go to CMS> Pages>Home page
  2. Switch to the Content tab and into the html code block paste the following code:

 

 {{block  type="catalog/product_list" category_id="7"  template="catalog/product/list.phtml"}} 

 

Make sure the category_id="7" value matches your category ID. When you are done click the Save button at the top.

In case you want to control the number of columns in product listing please use the following code:

 

 {{block type="catalog/product_list" column_count="4" category_id="7" template="catalog/product/list.phtml"}} 

 

Where the column_count value is the number of columns

Make sure you cleared Magento cache. Otherwise your changes may not affect your store frontend.

No comments:

Post a Comment