Related products on product description page in Magento



By default Magento displays the Related products block on the product description page sidebar, and you want to move related products from default sidebar location into main product page for moving related products from the default sidebar position to the main product page follow the steps below:

Step 1. Open catalog.xml file for this navigate to the app/design/frontend/default/your_custom_theme/layout/ or you can find this file app/design/frontend/base/default/layout/ open it in the editor of your choice.

Step 2. In catalog.xml search for the catalog_product_view section

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

Remove or Comment out the above code.

Step 3. Search for the catalog_product_view section again and copy and paste the code as like given below:

<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>

Step 4. Now navigate to the app/design/frontend/default/your_custom_theme/template/catalog/product/view.phtml or you can find this file app/design/frontend/base/default/template/catalog/product/view.phtml open the file in the editor of your choice, insert the given below code in the desired position where you want to display the related product block in the product description page.

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

Step 5. For editing the look of the related products Navigate to the app/design/frontend/default/your_custom_theme/template/catalog/product/list/related.phtml or you can find this file app/design/frontend/base/default/template/catalog/product/list/related.phtml, from here you can change the look and feel of the related products.

Step 6. Now refresh the cache from the Magento admin and delete the browser cache and refresh the page.

You have done, enjoy the custom work in Magento.