voodish logo
Skip to: Content | Navigation | Site map

Related products on product page in Magento

Move related products from default sidebar location into main product page in Magento.

1. Open catalog.xml, found in
app/design/frontend/default/YOURTEMPLATEFOLDER/layout/

2. In catalog.xml find the catalog_product_view section, around line 205. In the section, remove or comment out:

<block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>

and replace with:

<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="catalog/product_list_related" name="catalog.product.related" as="related" template="catalog/product/list/related.phtml"/>
</block>
</reference>

3. Now in your catalog/product/view.phtml you can print out the related products using

<?php echo $this->getChildHtml('related'); ?>

To edit the look of that list, edit catalog/product/list/related.phtml

DEMO

This demo shows a 1 column design with the related products down the right handside in a Horizontal Carousel. View Demo

Related Articles

Comments RSS Feed

13 Comments

  1. amit soni July 29, 2010

    it doesnot work for me.I did same opertions as told by you.Can you figure out why

  2. Go to Top of the page

  3. admin July 29, 2010

    Which version of Magento are you using? This was tried and tested on 1.4x

    Are you receiving any Magento errors messages?
    Also, take a look through your server logs and let me know.

    If you still can’t get it to work then send me a mail, using the contact form, and I’ll get it working for you.

  4. Go to Top of the page

  5. mahesh March 24, 2011

    It is not working for me also, not outputting anything, from where to upload realted products? i uploade from catlog->manage products->edit->related product

  6. Go to Top of the page

  7. admin March 24, 2011

    ok guys, will do some checks… are you using 1.4x?

  8. Go to Top of the page

  9. admin March 24, 2011

    Are you definitely using the 1 column layout for this?

  10. Go to Top of the page

  11. admin March 24, 2011

    I’ve sent you an email, I would like to try and get to the bottom of this, as it works fine for me. Can you supply me with access so that I can check for you?

  12. Go to Top of the page

  13. mahesh March 25, 2011

    I got solution for my problem, its working now…thank u

  14. Go to Top of the page

  15. admin March 25, 2011

    @mahesh, when you get a moment, could you let everyone know what the problem was?… was there anything missing from the explanation above?

  16. Go to Top of the page

  17. Mahesh March 25, 2011

    Hi - The file name related.phtml was changed to view-related.phtml by my coligue. When i follow the instructions above properly, it starts working….
    thanks for the help.

  18. Go to Top of the page

  19. Raju May 4, 2011

    Hi
    This worked for me thanks.
    Please check you are declaring the block at right place in xml file.

  20. Go to Top of the page

  21. Damo May 27, 2011

    Hi,
    Great article on moving the related products block to the middle column thanks - how would I get this to work with the hellowired theme and show as a tab? I have upsell on a tab in catalgoue.xml like this…
    upsell_productsAlternativescatalog/product_list_upsellcatalog/product/list/upsell.phtml

  22. Go to Top of the page

  23. Damo May 27, 2011

    upsell_products Alternatives catalog/product_list_upsellcatalog/product/list/upsell.phtml

  24. Go to Top of the page

  25. selepok October 7, 2011

    Thank you very much!

  26. Go to Top of the page

Leave a comment