Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9126017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:56:22+00:00 2026-06-17T06:56:22+00:00

I am looking for the controller / function which shows the Related Product child

  • 0

I am looking for the controller / function which shows the Related Product child html.

On the product view page it is simply called via <?php echo $this->getChildHtml('related'); ?>

I have modified this phtml file to count the related items and show an alternate fallback of a random selection of products by using this:

(Within /catalog/product/list/related.phtml)
<?php if($this->getItems()->getSize() > 1): ?>
Show the products
<?php else: echo $this->getLayout()->createBlock('cms/block')->setBlockId('related-products-fallback')->toHtml(); 
endif;
 ?>

This works perfectly when testing pages with 1 or more related products, but if there are no related products then the Child ‘related.phtml’ is never called.

I’ve searched the magento file structure for anything ‘related’ but can’t find the magic file anywhere. I imagine it would be a relative simple if statement somewhere.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:56:23+00:00Added an answer on June 17, 2026 at 6:56 am

    Controller is in app/code/core/Mage/Catalog/Block/Product/List but you should really avoid editing the core directly. Check your block ID and be sure you empty your cache! Flush all cache types and check again!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for an existing view controller like ABPeoplePickerNavigationController that instead of showing contacts
I'm looking for a good example that shows how to handle (in the controller)
I'm looking for patterns and principles for using with WPF and NHibernate in model-view-controller
I'm trying to write a sitemap.php which acts differently depending on who is looking.
I implemented a thumpsup function in php. the view holds a thumpsup button and
I am looking to write a plugin controller in Cocoa that loads bundles, and
I'm looking for a one line route to route dashed controller and method names
I'm looking for a best practice suggestion. I've got a ShoppingBag Controller with a
I am looking to build an app that has 6 view controllers laid out
We're currently looking into doing some performance tweaking on a website which relies heavily

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.