Top VPS Hosting Provider

Welcome to the myhosting.com Forums.
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    sobharanimuktha is offline Junior Member
    Join Date
    Mar 2011
    Posts
    5

    Default Display New Products in home page by category + magento

    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

  2. #2
    suwunk is offline Super Moderator
    Join Date
    Aug 2010
    Posts
    1,080

    Default

    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

    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
    Last edited by suwunk; 2011-03-04 at 04:11 AM. Reason: Credit goes to Noam Design Group

  3. #3
    sobharanimuktha is offline Junior Member
    Join Date
    Mar 2011
    Posts
    5

    Default

    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



    Regards,
    Sobha Muktha

  4. #4
    suwunk is offline Super Moderator
    Join Date
    Aug 2010
    Posts
    1,080

    Default

    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
    Code:
      {{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.
    Last edited by suwunk; 2011-03-04 at 05:15 AM.

  5. #5
    sobharanimuktha is offline Junior Member
    Join Date
    Mar 2011
    Posts
    5

    Default

    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

  6. #6
    suwunk is offline Super Moderator
    Join Date
    Aug 2010
    Posts
    1,080

    Default

    If you want to display new products on the home page, but want them organized by category
    Use this code:
    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.
    Last edited by suwunk; 2011-03-04 at 09:30 AM.

  7. #7
    sobharanimuktha is offline Junior Member
    Join Date
    Mar 2011
    Posts
    5

    Default

    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

  8. #8
    auryn is offline Master Member
    Join Date
    Jan 2011
    Posts
    297


 

Similar Threads

  1. Display products on home + magento
    By sailesh in forum Beginners
    Replies: 4
    Last Post: 2011-03-04, 12:37 AM
  2. wifi at home
    By WrigleyF in forum Beginners
    Replies: 1
    Last Post: 2010-09-13, 07:59 PM
  3. page display
    By PotsNPans in forum Troubleshooting
    Replies: 1
    Last Post: 2010-08-18, 05:08 PM
  4. Home Page
    By aaamgr in forum Beginners
    Replies: 2
    Last Post: 2010-05-03, 11:19 AM
  5. Published Page not what I published - asp.net master page
    By jimbaum in forum Troubleshooting
    Replies: 1
    Last Post: 2008-09-10, 11:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts