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.)

i have tried what is given above but it does not work. please help.
Hello Rashmi,
Where are you adding it? What version of Magento are you using?
but how to control the number of products display in row and column? Say I want to have 8 new products to display at the main page, with 4 products in a row in 2 columns, is that possible?
hi
I placed this above code to CMS->Manage page-> Home page
bit it does not working
new.phtml also here catalog/product/
Thanks for the tip re: setting ‘New From Date’.
Eddie
Hi Richard,
I’ve tried the above and it works although, in my template when i set more then 3 products it goes off the table, instead of adding a second row.
Any ideia how to fix it? I’ve tried to set a limit on css, though it doesn’t seem to work…
@Hello bhuvana,
Are you pasting this into the Content field? This is where you paste it. Also, (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.)
@Hey Jennifer,
It sure is! To display 8 items locate the file in your Magento installation (app/code/core/Mage/Catalog/Block/Product/New.php). Make a copy of this. You never want to modify Magento core files.
What are core files? Files located in app/code/core folder. If you have a need to modify one of them, you need to create a duplicate of that file with the same directory path to app/code/local. So for the New.php file you just made a copy of, copy it to app/code/local/Mage/Catalog/Block/Product/New.php. Now edit the file you just copied and make the following changes:
Change to the number of products to display:
@Hey Layus,
Thanks for your comment! The new products are outputted in tables so you can modify the source to suit your needs in /app/design/frontend/default/YOUR_TEMPLATE/template/catalog/product/new.phtml
Thanks for this great tip. Works but I am getting the block duplicated. Any ideas why this is happening?
Philip
Thats a great tip, thank you.
Would there be a way to get it to show new products from a certain category?
Thank you.
Simon
@Simon, Sure there is! Just marked the product in the category you want to display as new using “Set Product as New from Date” and “Set Product as New to Date” options in the “General” product information page.
@Philip, Happy this helped you. Check the products that you’ve specified as new.
Hi Richard.
Thanks for replying.
What I’d like to do is for example, on the “fruits” page display the newest fruits at the top of the page, followed by the regular fruits category; then on the “vegetables” page, display the newest vegetables at the top of the page, followed by the regular vegetables category.
Is that possible?
Thank you.
Simon
@simon
If you make a var_dump of your product object variable in your template, you will see there is the category-ids field
I think you can use it to arrange your products using their category
i set the Set Product as New from Date to yesterday and Set Product as New to Date to tomorrow
but nothing happens
ok i found the error
if copying the displayed test its no good. u have to select the icons that pops up by hovering the text with the mousepointer and select the icon “copy to clipboard” then the code is right,
Tx for the code just what i needed.
@Hucks
Try clearing your cache and the Magento cache.
This worked great for me. Nice and easy. Thanks!
Thanks Richard.
As I am a magento developer, I am glad to read your post.
Hello,
great write up! It works for me, but I get duplicated blocks, and I don’t know why… Any ideas? It doesn’t matter what product I set up as NEW, still I get duplicated New Product blocks.
@Justin, are you sure you have 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.
Hey Richard, this is great. However, when I put the code in my page, it overlaps my other design, is there a quick way to resize the block? I went into the new.phtml file and I can’t find what I’m lookign for.
Scratching my head for a good while trying to get more than 5 latest products to show up, your instructions worked perfectly – THANKS!
Thanks for this code. I have it working but with problems. The main problem is that all products are being displayed, even simple products with a “nowhere” display setting. Any suggestions as to how to display only products I’ve chosen to display in my “catalog,search”?
@Daniel, You should be able to easily do this with CSS. Have a link for me to see?
@Elizabeth, Just mark the product in the category you want to display as new using “Set Product as New from Date” and “Set Product as New to Date” options in the “General” product information page.
Richard, Thanks for your response. I always set these dates — even before I figured out how to diplay new products.
Here’s what I do and here’s where the problem seems to lie: I start by creating a new, blank “configured” product. I fill in the form including the “Set Product as New from Date” and the “… New to Date.” Then, in “associated products”, I create the various simple products related to the configured product. Now all of the related simple products are set to “enabled” and “nowhere” but they automatically have the dates entered. It sure would be much more convenient for the “new products” function to select only from “catalog,search” enabled products instead of having to manually delete dates from all of my “nowhere” products.
I found the solution. Ok , what should we do to make visible the new products in your website(homepage or else where) :
Firstly, don’t forget to sign out the product attributes “Set Product as new from date”-”Set Product as new to date”in general information. Try to edit “from date” before today.
Then if you want to see more than 5 product in your homepage :
don;t forget about the core: app\code\core\Mage\Catalog\Block\Product\New.php and
edit the constant: const DEFAULT_PRODUCTS_COUNT = 8;
This constant respond to how many products will be visible in your page.
Nice post and thread! I seems a lot of people are having problems with the homepage in Magento, which is quite a crucial part of the site! Thanks Richard for all your info on this.
Hi Richard,
Now its working fine in my site. Thanks for your help.
The new products title showing as “New Products”, I would like to show as “New Products for October 2009″
can you please help me out.
With Regards
Venkat
Hi Richards,
It seems you have deleted my comment. I sincerely posted my comment.
Anyhow i used the code you have mentioned above.
I have updated the code with 8 products. It is coming in single row and overlapping the right sidebar.
Help me to show 4 products a row and upto 5 rows please
site http://www.theplrmart.com
Regards
venkat
@Venkat, I didn’t delete your comment just didn’t get around to it
Your most likely going to change the code to do this since it’s in tables. If you eliminate the table layout and replace with divs and a class that’s a floated element, you can display it any way you want.
Hi Richard,
Thanks for your response. I am sorry to ask you, can you tell me which file i need to change the code in order to display correctly.
Since i changed the products to 8 first to see 4 products in a row. That time i have right sidebar also, then the 8 products started showing overlay on the right sidebar and its displaying only 5 out of 8 in a single row.
As you are the expert please help me in this regard
Thanks in advance
Venkat
cant get it to show more than 4 products
i have made the categories
/app/code/local/mage/catalog/block/product
copyed NEW php to product folder,
and changed the const DEFAULT_PRODUCTS_COUNT = 5; to const DEFAULT_PRODUCTS_COUNT = 8;
and updated cache,
nothing happens ?
Hi!
I have a problem with new products, i search in all answers but is a different problem. I add my products but it doesnt appear in new products, i update the date “Set Product as New from Date ” and ” Set Product as New to Date” and put the date of yesterday i both of them.
but today when i open the site the products doesnt appear. I dont know why sometimes the products appear and another one disappear. Thxs for all!
Hey Richard,
Was wondering if theres a way to edit the coding, so that it shows the 10 most recently added products to the store without using the new from and to date flag. This will be very useful to me (and many others i would believe) because i dont update my site with new products very often, and lets say i normally flag a products as new for a max period of 7 days, after 8 days this coding wont show any products and my homepage will be lacking content.
I want it to always show the last 10 products regardless of whether its still flag as new. Hope you can help, thanks in advanced!
Hi there, I got the new products on home page. But I have problem related to product url. Product url for new products is like http://sitename/catalog/product/view/id/priductID/s/productname and everywhere else it is like “http://sitename/productname.html”.
Can you please help me on this?
What’s up Richard,
Wow, I’m really impressed with this, man? I can’t believe you actually take the time to respond to every reply personally. I hope karma is good to you – you deserve it
Just wanted to say thanks for this small but helpful explanation. It has proven essential in a website I was making for someone and you saved me a whole bunch of time trying to reinvent the wheel. Not just your own post, but your replies to further inquiries as well! Thanks so much!
Keep up the good work man,
~Adrian
Richard, you are a hero! Thank you so much for sharing this with us. I really am so happy to having found a solution to this issue
)
Big smile from DK
Hey! A little note: I just noticed this little line in the “new.phtml” (/app/design/frontend/default/YOUR_TEMPLATE/template/catalog/product/new.phtml) of my theme:
5): continue; endif; ?>
This would make the loop stop after 5 fragments, even when DEFAULT_PRODUCTS_COUNT is set to any higher variable. I think I saw some people here having problem with this? This might solve their problem
Hope it helps!
Sorry, apparently that PHP line somehow didn’t make it through your system. Could you fix it in the other comment for me, Richard? You can remove this one afterwards. Thanks!
The line I was talking about was:
~?php if ($i>5): continue; endif; ?~
thank you. it works like a charm. u ve saved me.
This is exactly what I needed for a new build. Thanks so so much for your knowledge!
@Spencer Thanks!
@gachaga, Thanks!
@Jeannine,
@Adrian, Thanks!
@Richard,
i just want to say thank you!
@reeve24,
Your welcome!
@Raqueliii,
Did you try clearing your cache?
@Kalamingo,
Sure read this comment (http://www.richardcastera.com/2009/05/21/magento-display-new-products-on-the-home-page/#comment-79)
@prits,
Check your settings for the URL and clear the Magento cache.
hello sir I am beginner with magneto. so there is no one that help me . sir tell me that how i can remove the default blocks in magneto home page, like back to school and some others, i us 3 column layout, waiting for ur kind response.
thanks a ton richard above trick worked on mine
can u help me in below thing.
i want to create a page so that i can show top 10 best products on click of a link
if u dont know my e mail by replying to this comment section u can use this vaseem@doomshell.com
Thanks
How can I get only the InstockItem only in product collection at New.php for the display in the new.phtml
HI Richard and many thanks for some really informative posts.
I need to do exactly the same as Simon has requested above but cannot find a way to do this despite several days of trying – any ideas would be much appreciated.
Thanks Richard
grate help
@M Atiq Ullah, you can easily achieve this by logging into the back end and go to the CMS home page and change the layout to 1 page layout.
@Vaseem, there is a good article on how to do that here, http://inchoo.net/ecommerce/magento/bestseller-products-in-magento/
hey there,
With regards to the new products on the homepage, I wanted to know about making 2 rows of 4 instead of the default 3 products showing.
Thanks in advance for the support
M
editing any files to change the products_count value is not necessary
you just have to set the number of products you want to display via products_count:
{{block type=”catalog/product_new” name=”home.catalog.product.new” alias=”product_homepage” products_count=”40″ template=”catalog/product/new.phtml”}}
i displaying products form new.phtml file on my home page.
Right now i display only one product [Product Image] on Home Page
but what i needed is to display random image from Date set [From & To] on each of the products
So at time the random image will be displayed from product for which date has been set..i want to know a if i set today’s date on my new product and date of tomorrow and other products having date from yesterday to day after tomorrow so which product should display first ?
can u have your tip on this…
Thank you…
Guys, you don’t need to edit new.phtml to get how many rows you want. in your CMS Page just add column_count=”4″, result will be like this:
{{block type=”catalog/product_new” name=”home.catalog.product.new” column_count=”4″ alias=”product_homepage” template=”catalog/product/new.phtml”}}
How to create a csv file
i would like to display new product image and its description in left navigation of my home page.i dont know how to do…please anyone help me…
Thanks Richard. Came 2 know abt Magento’s Hidden Gem.
Cheers………
I have to display 24 new products on home page, I tried all solution provided here, but unable to get sucess, please suggest me appropriate solution.
I also tried
{{block type=”catalog/product_new” name=”home.catalog.product.new” column_count=”8″ products_count=”24″ alias=”product_homepage” template=”catalog/product/new.phtml”}} in home page in CMS.
but it is showing maximum 9 products only.
@Jagat, Thanks!
Hi richard,
i have a media folder which contains the product and categories contents i do have a csv file which contains the product details.
How to import these to my site please give me a step by step procedure for this process.its little urgent(csv import and export options)
Thanks
Sriraman
Great information. Thanks for sharing!
How can I get products from a different RSS feed to show up. For example, I keep a category of New Releases and use the RSS Feed per category option. So instead of using the “set product from new..” on EVERY item, which I find DOESN’T work when importing from a CSV, can I just use a different category RSS feed, like mentioned above the “new releases” one, to show the products?
After I’ve copied the new.php file to local folders and edited it – should I then post it back into mage?
hey richard, how do change the number of columns of products to 3 so that they fit exactly in the homepage. The codes work properly but there are additional lines on the home page. Am very new to magento. thanx a lot!
HI richard, how do change the number of columns of products to 3 so that they fit exactly in the homepage. The codes work properly but there are additional lines on the home page. Am very new to magento. thanx a lot!
HI Richard i have done Like this as below video URL
and as you said also but i cant get Products on home page can you help me?
http://vimeo.com/1070986
as i done as above video i get this message on home page
There are no products matching the selection.
i have set date setfrom and set to in general still i get this error
can u help me?
hey after getting Lots of spending time on that i get Solution
if some 1 is find message like this
There are no products matching the selection.
and first check setfrom and settodate fill it
and then paste this content
{{block type=”catalog/product_list” category_id=”8″ template=catalog/product/list.phtml}}
i get There are no products matching the selection. because i double quote template so when i removed that double quote then all products are showing of that category
Hope for some 1 usefull….