Tuesday, July 26, 2016

Magento- get product collection by customer reviews

Magento- get product collection by customer reviews

<?php
$collection = Mage::getModel('review/review')
                ->getResourceCollection()
                ->addStoreFilter(Mage::app()->getStore()->getId())
                ->addFieldToSelect('*')
                ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
                ->addRateVotes();
$collection->getSelect()->group('entity_pk_value');
               
//echo $collection->getSelect();

print_r($collection->getData());

?>

No comments :

Post a Comment