As a magento developer display related product on product view page.It’s easy to show related product by following few easy steps. First we will have to add products to a particular product as related product. Screen shows product added as related product

Related Product

After selecting products it will show on your product view page if you can`t view related product on it .Do following steps it`s very easy to follow all the best friends.

1)Open catalog.xml

catalog.xml file available in .

{magento root}/app/design/frontend/default/{your theme}/layout/catalog.xml .

If you not have the file just copy file from

{magento toot}/app/design/frontend/base/default/layout/catalog.xml

to your theme i already mention the path.

2) Remove & Add some xml in catalog.xml

Search catalog_product_view in

{magento root}/app/design/frontend/default/{your theme}/layout/catalog.xml

. Command or remove the following line from there .Search in catalog.xml "catalog.product.related" in appropriately line 258 under <reference name="right"> .

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

add following line in catalog.xml . Search in catalog.xml "<reference name="content">" in appropriately line 189 . Below "<block type="catalog/product_view"..........>" this linl add following line.

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

3) Adding related product in product view page.

Adding some code in view.phtml available in

{magento root}/app/design/frontend/default/{your theme}/template/catalog/product/view.phtml

If you not have the file just copy file from

{magento toot}/app/design/frontend/base/default/template/catalog/product/view.phtml .

Add following line in where you want to view.

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

4) Related Product view


Related Product View