I am using Magento 1.5 and am attempting to include a small box in my sidebar for a random product showing a product image, product name, star rating and part of a review.
I have managed to get Magento displaying a random product in the sidebar, unfortunately I cannot seem to find a way to select the random product based on if it has a review or not, and I also cannot find a way to load a review summary into the sidebar template I'm using.
I found the following piece of example code but it just throws the good old call to non object error.
<?php
$storeId = Mage::app()->getStore()->getId();
$summaryData = Mage::getModel(‘review/review_summary’)
->setStoreId($storeId)
->load($_product->getId());
/* @var $summaryData Mage_Review_Model_Review_Summary */
/*
array(
['primary_id'] => 147
['entity_pk_value'] => 166
['entity_type'] => 1
['reviews_count'] => 1
['rating_summary'] => 80
['store_id'] => 1
)
*/
?>
if anyone has any ideas how to get this working, it would be greatly appreciated.
Thanks in advance!