Yep been in your position and it can be frustrating!
In Administration
1. Goto the CMS\Manage Pages
2. Open the Homepage
3. Select the Custom Design Option
4. Add the following
Between the section <reference name="content"> and </reference> add in the code for New Products as shown below
<reference name="content">
<!-- New Products --> <block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="product_featured"/>
</reference>
Now, Just make sure you have some products which have the date parameters set for the new products.
You should be good
cheers
Brendan
Thank so much for the post. I followed the directions and got new products to appear on the homepage, However, the products are not centered and are aligned to the far left--flush with the left most border of the left column.
How do I center the New products grid on my home page?
Hello,
When I follow the directions above, I am getting New Products but they are aligning with the Left border fo the site?
Can anyone tell me what I have done incorrectly?
Also, I was able to edit the /app/design/frontend/default/default/template/catalog/product/new.phtml FILE
Around line 32, the code below is the relvant part wherein the “2” of line <?php if ($i>2): continue; endif; ?> configures the number of products to display per row.
<?php $i=0; foreach ($_products->getItems() as $_product): ?> <?php if ($i>2): continue; endif; ?>
How do I get the homepage to display a specified number of rows. Let’s say I want 4 rows with 3 products on each row.
Edy did you manage to find a solution, I have a problem with new products it displays 5 products only invading my right column blocks and getting behind the fifth product, how can I tell magento to display 4 products and then create a new row to display the other products, this is driving me mad and I can’t believe the store just doesn’t does this like others does natively.
Edy did you manage to find a solution, I have a problem with new products it displays 5 products only invading my right column blocks and getting behind the fifth product, how can I tell magento to display 4 products and then create a new row to display the other products, this is driving me mad and I can’t believe the store just doesn’t does this like others does natively.
thanks
Hi, well to change it to display only 4 products just check your new file located “/app/design/frontend/default/default/template/catalog/product/new.phtml” now change this <?php if ($i>5): continue; endif; ?> to <?php if ($i>3): continue; endif; ?>. now it will display only 4 products. Now, about ading a new row, I don’t know how yet, but I’m checking it now.
Edy did you manage to find a solution, I have a problem with new products it displays 5 products only invading my right column blocks and getting behind the fifth product, how can I tell magento to display 4 products and then create a new row to display the other products, this is driving me mad and I can’t believe the store just doesn’t does this like others does natively.
thanks
Hi, well to change it to display only 4 products just check your new file located “/app/design/frontend/default/default/template/catalog/product/new.phtml” now change this <?php if ($i>5): continue; endif; ?> to <?php if ($i>3): continue; endif; ?>. now it will display only 4 products. Now, about ading a new row, I don’t know how yet, but I’m checking it now.
Best Regards
L. Nunes
I know this is an older thread, but I am having I believe a similar problem. The problem only shows in IE6 (don’t use IE7 so don’t know) while FireFox and Safari display just fine.
I tried the suggestion above, but other than less items showing up, new products are still listed on the bottom left instead in the center.
Has someone found a solution? As I am spending way too much time in layout/design and am not getting products listed.
If someone want to show more than 5 new product in home page.
Try This…
This example to show 10 items in 2 rows 5 products each.
You need to change the line in \app\code\core\Mage\Catalog\Block\Product\New.php
$products->setOrder(’news_from_date’)->setPageSize(5)->setCurPage(1);
change to
$products->setOrder(’news_from_date’)->setPageSize(10)->setCurPage(1);
Andneed to change new.phtml
<?php if ($i>5): continue; endif; ?>
change to
<?php if ($i==5): echo "</tr><tr>"; endif; ?>
<?php if ($i>9): continue; endif; ?>
If someone wants let’s say 4 rows, simply do this:
<?php if ($i==3): echo "</tr><tr>"; endif; ?> <?php if ($i==6): echo "</tr><tr>"; endif; ?> <?php if ($i==9): echo "</tr><tr>"; endif; ?> <?php if ($i==12): echo "</tr><tr>"; endif; ?> <?php if ($i>12): continue; endif; ?>
This ($i==3) shows the products on the first row. If you want let’s say 4, than you have to chage also the other numbers (6,9,12) to 8,12,16
I made the change in new.php to reduce the number of items to 4 from the default of 5 and it worked perfectly—although the code looks a bit different than above. This is the line I changed:
const DEFAULT_PRODUCTS_COUNT = 4;
I also made the changes above to new.phtml like so:
<?php $i=0; foreach ($_products->getItems() as $_product): ?> <?php if ($i==4): echo "</tr><tr>"; endif; ?> <?php if ($i==8): echo "</tr><tr>"; endif; ?> <?php if ($i==12): echo "</tr><tr>"; endif; ?> <?php if ($i==16): echo "</tr><tr>"; endif; ?> <?php if ($i>15): continue; endif; ?>
But I have two problems:
1. It’s not adding the other three rows. (I wasn’t sure if the number in the final line should be 16 or 15 but either gets the same result so far.)
2. It’s not showing the most recent products. The products themselves should be okay as they are showing under “Your Recently Viewed”.
I’m a novice (to say the least) so I hope I’m communicating the info okay. Any suggestions would be greatly appreciated!
Hi, thanks very much for your reply. I made those two changes and the results were that I’m now back to seeing five new products with only one row (as if no changes had been made).
What have I missed?
I’ve opened both files back up to double-check my edits and this is what those lines look like. These are the only edits I’ve made to these files and I’m editing and saving through cPanel.
const DEFAULT_PRODUCTS_COUNT = 16;
<?php $i=0; foreach ($_products->getItems() as $_product): ?> <?php if ($i==4): echo "</tr><tr>"; endif; ?> <?php if ($i==8): echo "</tr><tr>"; endif; ?> <?php if ($i==12): echo "</tr><tr>"; endif; ?> <?php if ($i==16): echo "</tr><tr>"; endif; ?> <?php if ($i>16): continue; endif; ?>
Ah, I didn’t think about System/Configuration/Catalog/Frontend—unfortunately, however, that doesn’t seem to be the problem. I even changed the Grid allowed values (4,8,12,16) and the Grid default value (tried both 16 and 4) and it didn’t impact the front page.
I changed ($>16) to 15 as well.
I appreciate your time; if you’ve got any other suggestions I’m listening!
Sorry Rick, I have no other suggestions for the moment.
I am not a programmer, all I’ve changed in my custom theme I’ve learned here, on the forum. And everything I’ve posted here were parts of code from other threads that helped me.
Hope you can make it somehow.
Cheers!
EDIT: However, on a second thought, I might have the solution. Please tell me, what is the script in your homepage? Please check CMS/Manage pages and then select homepage and look for the script in General information/Content or Custom design/Layout update XML.