How To Show Related products on product page in Magento.?

Get Related products on product page in Magento.

In Magento product view page there is complete information with image, features, technical specification and description .If you want to show related products on product view page after short description then you need to follow the below steps to get the desired result.


Step 1:- Open catalog.xml file from location (navigate to the app/design/frontend/default/yourtheme/layout/ catalog.xml page) or you can find this file catalog.xml page open  in your editor .


Step 2:-Now search for the catalog_product_view section in catalog.xml file and find the following code.

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

and replace with the below code to get related products accordingly.

<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 3:- Now navigate to view.phtml ( located at app/design/frontend/default/your_custom_theme/template/catalog/product/view.phtml) and add the given below code in the desired position where you want to display the related product block in the product view page.

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

Step 4:-   Please Clear Your Cache From Admin Panel To See All Changes respectively.


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *