View Full Version : Display New Products in home page by category + magento
sobharanimuktha
2011-03-04, 12:39 AM
Hi
I need to display the latest products in home page by category wise
I have used the below code in template home page
{{block type="catalog/product_new" category_id="<?=$_main_category->getId()?>" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}
But it was displaying as it is in browser.
Can you tell me what is the problem?
Regards,
Sobha Muktha
suwunk
2011-03-04, 04:02 AM
Hi Sobha Muktha
Have you checked this?
Note that you must have some new products in your catalogue for anything to show when you do this. In this context new 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
Magento - Wiki - How To - Display products on home page (http://www.magentocommerce.com/wiki/groups/248/display_products_on_home_page)
If you want to display new products on the home page, but want them organized by category
Use this code:
{{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.
Cheers
sobharanimuktha
2011-03-04, 04:54 AM
Hi
There are new products in the site.Still i am getting the same problem
I have not added the block in cms block.
I have added the block in PHTML file. Can we do it or not?
Because i have to populate the new products based on the category.Please refer the image below
http://warriar.thestagingurl.com/test.jpg
Regards,
Sobha Muktha
suwunk
2011-03-04, 05:12 AM
Don`t add the code on PHTML file, You should add that code in your CMS page.
Go to "CMS" then "Manage Pages" and select "Home Page" from the list of pages. Now paste this code snippet
{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}} to show products labeled as "new" on your front page.
sobharanimuktha
2011-03-04, 06:03 AM
Hi,
If i add in CMS pages i will get only new products not based on the category selected from the tab.
How can i do that? is there any way?
Regards,
Sobha muktha
suwunk
2011-03-04, 09:23 AM
If you want to display new products on the home page, but want them organized by category
Use this code:
{{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.
sobharanimuktha
2011-03-07, 12:52 AM
Hi All,
Please refer the above screen shot.
I need to display the categories in home page as tabs
If i click on tabs I need to display the latest products from the particular category.
for this i have done the category population. I have struct with latest products based on category selected.
Is there any way to do it
I can't go with block adding in cms bases.Becoz category id i don't know to add it as static
I want to do in Phtml file.
Is there anyway to do it.
Please help me
Regards,
sobha
auryn
2011-03-15, 12:06 PM
Hope this helps:
http://myhosting.com/blog/2010/08/tutorial-adding-products-categories-magento-website/