Magento: Display New Products On Home Page – By Category!
- Category: questions, web design, web development
Since I posted the code to add new products on your Magento home page, we got a bunch of requests on how to display new products per category, instead of globally.
If you only want to display new products from a specific category – it’s easy. All you have to do is make sure that in your catalog, you’ve set products “as new” only to products that belong to that category.
If you want to display new products on the home page, but want them organized by category – we have a very easy way to achieve this very quickly! Simply add this code in your CMS page:
{{block type="catalog/product_list" category_id="2" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/featured.phtml"}}
Where “featured.phtml” is a copy of the default new.phtml that you can style and format anyway you’d like. In the case above, we’re displaying products from the category id number 2. Repeat the code above to display products from any other categories from your store.
Important note! Now the products that show up first in your category, will be displayed on the home page. To control which products show up first, simply go to Catalog -> Manage Categories and click on the category you’d like to edit. Then click on “Category Products” and set the position for your products. That’s it!
This great Magento template for digital products uses this very method to display new products by categories on the home page.
Questions? Feel free to ask in the comments below.
Note: tested on Magento 1.3.2.4 only.
Noam - May 9th, 2010
Noam - May 13th, 2010
But I tried it out and unfortunately it is not displaying anything. I also tried out to display all new products with the code in your other post you mentioned here and that worked fine. I also copied the new.phtml and renamed it to featured.phtml and select a category which has the new products. But no avail.
when I change it to block type=”catalog/product_new instead of _list it shows all new products, do I have to create a block type or something?
I appreciate any help!
Using Magento 1.4.0.1
Hope some one can help me.
{{block type=”catalog/product_list” category_id=”2″ alias=”product_homepage” template=”catalog/product/featured.phtml”}}
Is there a way of listing the newest products based on the settings in
admin/catalog/manage products/
Set Product as New from Date + Set Product as New to Date.
Thanks
{{block type=”catalog/product_list” category_id=”3″ alias=”product_homepage” template=”catalog/product/featured.phtml”}}
the above code was copied to content text area and clicked on save.
It was not working for me. Please help out to solve this.