Categories: Magento

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.


Rohan pathak

Recent Posts

What Is a Progressive Web App? Why Would You Need One?

App usage is growing steadily without showing any signs of slowing down. Hence, it is no surprise that mobile applications…

11 months ago

7 Most Popular Paid Online Advertising Strategy

As the world has grown more digital, businesses have adapted themselves. An effectual adaptation includes online advertising. Offline advertising styles…

12 months ago

The Importance of User-Centered Design in Mobile App Development

Step into a world where apps dance to the user's tune. Picture Instagram, a photo-sharing sensation that swept the globe.…

1 year ago

Healthcare Mobile App Development: A Complete Guide for Founders

COVID-19 has led to a digitalization of lifestyle. As patients are taking their mental and physical health more seriously, healthcare…

1 year ago

Exploring Diverse WordPress Theme Niches: A Comprehensive Guide

Introduction WordPress, an immensely popular content management system (CMS), powers over 40% of the internet. What makes WordPress even more…

1 year ago

8 Awesome Blog Content Ideas for Movers to Skyrocket the SEO

For moving companies trying to capture their market share amidst stiff competition, a tip or two about what they can…

1 year ago