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:
1 |
{{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 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:
This constant respond to how many products will be visible in your page.
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:
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:
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:
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
in home page in CMS. but it is showing maximum 9 products only.
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
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….
i have tried what is given above but it does not work. please help.
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?
Yes! You can control that in the admin section.
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 idea how to fix it? I’ve tried to set a limit on css, though it doesn’t seem to work…
Thanks for this great tip. Works but I am getting the block duplicated. Any ideas why this is happening?
Philip
That’s a great tip, thank you.
Would there be a way to get it to show new products from a certain category?
Thank you.
Simon
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. 🙂
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.
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 looking 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”?
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 up to 5 rows please
site http://www.theplrmart.com
Regards
venkat
Hi!
I have a problem with new products, i search in all answers but is a different problem. I add my products but it doesn’t 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 doesn’t appear. I don’t know why sometimes the products appear and another one disappear. Thxs for all!
Hey Richard,
Was wondering if there’s 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 don’t 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 :o)
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!
thank you. it works like a charm. you’ve saved me.
Just what I needed! Thanks!
I have created a duplicate of new.phtml, so that I could modify a few things about it in order to allow it to better fit my theme. One thing I cannot figure out is how to remove the bullets that appear to the top-left corner of each product image. I am using Dreamweaver to edit, and if I simply delete the bullet in ‘Live’ view, the products appear in a single column with the ‘Add to cart’ button being pushed to the very bottom of the column. I would greatly appreciate any help you can offer!
Screenshot here: https://docs.google.com/open?id=0B0Ss17x8m3h3Nm5NeEpGdmZ1NFU
Here is my code:
This is exactly what I needed for a new build. Thanks so so much for your knowledge!
Richard,
i just want to say thank you!
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 don’t 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
great help
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
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…
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 about Magento’s Hidden Gem. 🙂
Cheers………
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 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?
Thanks a lot for share….
very useful.. I was breaking my head for this..
Richard, thanks a lot! many long and wrong answers in the internet. but here i got the short and right one!
I am getting this error :-s
Fatal error: Call to a member function count() on a non-object in /app/design/frontend/default/modern/template/catalog/product/new.phtml on line 35
Bingo, to the point information. Works on the first try,
Thanks a lot for this….
Hi Richard,
I have two questions:
How can I make a category where the new products (new from -at) were be showed?
-is it possible to make a block for the right or left bar with the last 3 new products?? with thumbnail ?? I tryed it and tryed it, and… but successless
Best Regards
Brigitte
Richard is there a way to display all new products in one page. I want to display only 8 new products in homepage and underneath those eight items a link to show all new products and displayed as ordinary listing of products.
Brilliant – just what I was looking for.
Hi sir richard, Thanks for a GreAT post, it really helps me… one more thing, is it possible if i want to put new products in my left column? thanks in advance 🙂
Hello All,
I would like to get a New Arrivals page, where all new products are sorted by date (small date banner above every new set of products).
And a List/Grid mode so a infinite number of new products is possible to be viewed.
Can anyone help me with that? At this moment I’ve made a page with 4 columns 16 items, but I want it to go to a next page containing more new products.
Thanks in advance
If you have entered simple products to Magento and you want to rearrange how they position, can you do so?
I have trying re-SKUs, disabling/enabling products, moving to other categories temporarily.
Any ideas would be helpful. Thanks
I want to develop customize bundle product, how can I do it.
Hi Richard,
I’m having trouble getting the product price displayed on my homepage for the new products. What code can I add to my new.phtml file to make it look up the product price?
Thanks,
Annemieke
Hi Richard
I am working on Magento project, I have a issue some product url setting in home, i have home page in my site which display the product from different
Category e.g best sell, hot deal, new, so i want to change url on home as after domain name e.g it should be, http://sitename.com/best_sell/product_url.html but i want to same like http://sitename.com/product_url.html.. only on home page and inner catalog working is fine..
So is there any solution to fix the problem.?
Reply me it will be really appreciated.
how to have coming soon products in home page
Hi,
This was one of my questions for a long time. But I use ver. 1.5 and I’m not sure to add the code on design, Layout Update XML? or under Content?
Beside: I have defined 2 products as new, but there is no deference between new and normal products on front-end. Is there anything else I should do to show new products to be marked in some how?
Best regards
How Can Category product display Not Category_id Define Then Add new Category That Product To Display
I am baffled. in Magento ver. 1.5.1.0 it only displays the last product that has it’s date set, but it works fine in Magento ver. 1.6.0.0. However I need it working in 1.5.1.0
so if there are two products only one appears.
I just cant seem to work out why!
Any thoughts?
thanks
Jen
Thanks. It works for me.
Thanx Richard.
I wonder there is a way to show sold products too ?
Basically what I want is show 3 groups/tabs on homepage to show New, Sold, and Bestseller products on homepage.
Any Idea?
Has anyone confirmed this to be working in magento 1.5.1? I followed the example but can’t get the products to display. Are there any useful debugging techniques for me to check on why this does not work?
This is the best practise to show new product on home page in magento! Thank you!
Thanks for this. But I am curious. What code can I use if I want to put the code under the layout xml instead of the content section.
Thanks