Tuesday, October 1, 2013

RELATED PRODUCTS ON PRODUCT DESCRIPTION PAGE IN MAGENTO

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

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.

No comments:

Post a Comment

Please mention your comments.......