/**
* Getting reviews collection object
*/
$productId = $product->getId();
$reviews = Mage::getModel('review/review')
->getResourceCollection()
->addStoreFilter(Mage::app()->getStore()->getId())
->addEntityFilter('product', $productId)
->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
->setDateOrder()
->addRateVotes();
/**
* Getting average of ratings/reviews
*/
$avg = 0;
$ratings = array();
if (count($reviews) > 0) {
foreach ($reviews->getItems() as $review) {
foreach( $review->getRatingVotes() as $vote ) {
$ratings[] = $vote->getPercent();
}
}
$avg = array_sum($ratings)/count($ratings);
}
* Getting reviews collection object
*/
$productId = $product->getId();
$reviews = Mage::getModel('review/review')
->getResourceCollection()
->addStoreFilter(Mage::app()->getStore()->getId())
->addEntityFilter('product', $productId)
->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
->setDateOrder()
->addRateVotes();
/**
* Getting average of ratings/reviews
*/
$avg = 0;
$ratings = array();
if (count($reviews) > 0) {
foreach ($reviews->getItems() as $review) {
foreach( $review->getRatingVotes() as $vote ) {
$ratings[] = $vote->getPercent();
}
}
$avg = array_sum($ratings)/count($ratings);
}
You can also try a readymade extension called magento product reviews extension that lets the user to share their reviews and rating and anyone can see average rating on every product page.
ReplyDeleteUse Our Product Ratings and Reviews Software Increase sales and leads with Cus-tomers Reviews and Testimonials on Product and service. Improve Customers confi-dence with getting selections and reduce product returns.
ReplyDeleteProduct Reviews and Ratings
Customer Reviews and Feedbacks is an important source of information to identify the service provider’s performance. It measures the satisfaction level of the customers and ensures maintenance of positive relationship with customers. It helps to detect the root causes of customer’s dissatisfaction thereby helping in customer retention and improving the profit margins.
ReplyDeleteRating and Review Software
Review and Rating Software increase customer ’ s confidence, and can significantly increase sales. Online ratings and reviews provide incredible value and benefits that businesses cannot afford to ignore. Such system help businesses to establish credibility and improve their search engine visibility.
ReplyDeleteCustomers Ratings and Reviews
Hi,
ReplyDeleteThis is Great Coding Awesome information.. Thank you very much for sharing..
Wedding Websites | Web Development India
Magento Integration is explained very discreetly and effectively . thanks
ReplyDeleteI do agree with all the ideas you have presented in your post. They’re really convincing and will certainly work. Still, the posts are very short for newbies. Could you please extend them a little from next time?..Keep this great work
ReplyDeletemagento development company in bangalore
This comment has been removed by the author.
ReplyDelete