Whilst working on a Magento webshop I was asked to show the ratings and several custom attributes for the related products. Sadly I found out that the data collection Magento fetches by default for related products is limited to the data they want to show in their default theme so I had to find another way.
As it turns out this is pretty easy but poorly documented. Basically I just added the following within the foreach loop in ‘/app/design/frontend/default/templatename/template/catalog/product/list/related.phtml’.
$model = Mage::getModel('catalog/product'); $model->load($_item->getId());
Now instead of the default fields I can easily get all the other product data too with some simple functions like:
<?php // For the ratings echo $this->getReviewsSummaryHtml($model); // For a custom dropdown attribute named 'brand' echo $model->getAttributeText('brand'); ?>
Of course this also works in every other loop, as long as you have the product ID you can fetch all the data you want.