Tuesday, May 29, 2012

Magento: Display New Products on Home Page

If you've ever wanted to add new products in your Magento home page, it's fairly easy to implement. Go to "CMS" then "Manage Pages" and select "Home Page" from the list of pages. Now paste this code snippet to show products labeled as "new" on your front page:

 {{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}

 (Note that you must have some new products in your catalog for anything to show when you do this. This doesn't mean that you've recently added them; only products explicitly marked as new using "Set Product as New from Date" and "Set Product as New to Date" options in the "General" product information page in the admin tool will be shown.)

Method 2



 We have been using magento and have not found a single website that has a good help for magento so many problems. To start off showcasing new products on homepage using magento commerce was a problem when I was doing a project for a client. Getting new products in the front page is a key help that can increase sales of our products. This is already available in Magento but not easy to use.
To get it working it is very simple.
Here is the code
<reference name=”content”>
<block type=”catalog/product_new” name=”home.catalog.product.new” alias=”product_homepage” template=”catalog/product/new.phtml”>
<action method=”setProductsCount”><count>8</count></action>
<action method=”addPriceBlockType”>
<type>bundle</type>
<block>bundle/catalog_product_price</block>
<template>bundle/catalog/product/price.phtml</template>
</action>
</block>
</reference>
OK where to put this in?
  • Go to CMS > Pages > Home (this is your homepage it might be in a different name)
  • Choose it and there will be 4 tabs on the left. Page Information, Content, Design and Meta Data. Choose Design
  • Now paste it in Layout update XML
  • Click Save page at the top right.
So will this put your items on the homepage yet? No!
  • Go to Catalog > Manage Products and choose any product.
  • In the General Tab on the right there will be 2 options at the bottom Set Product as New from Date & Set Product as New to Date
  • Put in the desired timeline when your products are new. I would suggest 1 week if you update frequently and 1 month if you update rarely.

By PHP with 3 comments

3 comments:

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.

If you would like to show the newest products on your homepage add the following code to your CMS homepage.
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">

bundlebundle/catalog_product_pricebundle/catalog/product/price.phtml
4
4


If you would like to increase/decrease the amount of products per column, please change
4
to
6
Also if you would like to limit the amount of products shown, change
4
to
3
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.

I do agree with all the ideas you have presented in your post. They’re really convincing and will certainly work. Still, the posts are very short for newbies. Could you please extend them a little from next time?..Keep this great work
magento development company in bangalore 

Post a Comment

    • Popular
    • Categories
    • Archives