在我的 Magento 商店中,客户在 3 个类别(即价格)中查看我的产品。但是当我打印这些评级时,它只显示一个摘要而不是这 3 个类别(参见代码)。
<?php
//from http://www.exploremagento.com/magento/run-magento-code-outside-of-magento.php
require_once '../app/Mage.php';
umask(0);
Mage::app('default');
$review = Mage::getModel('review/review');
$collection = $review->getProductCollection();
$collection
->addAttributeToSelect('*')
->getSelect()
->limit(5)
->order('rand()');
$review->appendSummary($collection);
foreach($collection as $product) {
//var_dump($product->debug());
}
/* To get (what I assume is) 'star' rating. */
$ratingSummary = $product->getRatingSummary();
$starRating = $ratingSummary['rating_summary'];
echo $starRating . "<br/>";
?>
如何获得所有评分而不是摘要?