I"m trying to retrieve all reviews and ratings for a product. I'm not entirely sure how this could be accomplished. anyone care to help a brutha out?
I am currently trying to use:
$reviews = Mage::getModel('review/review')
->getCollection()
->addStoreFilter($storeId)
->addStatusFilter(1)
->addFieldToFilter('entity_id', 1)
->addFieldToFilter('entity_pk_value', $productId)
->setDateOrder()
->addRateVotes()
->getItems();
$reviewData = array();
if (count($reviews) > 0) {
foreach ($reviews as $r) {
foreach ($r->getRatingVotes() as $vote) {
$ratings[] = $vote->getPercent();
}
However, ratings[] is null when i dump the variables.