I created a custom block class for the bestseller products:


class Company_Bestseller_Block_Bestseller extends Mage_Catalog_Block_Product_Abstract
    public function getBestsellerProducts()
        $storeId = (int) Mage::app()->getStore()->getId();

        $date = new Zend_Date();
        $toDate = $date->setDay(1)->getDate()->get('Y-MM-dd');
        $fromDate = $date->subMonth(1)->getDate()->get('Y-MM-dd');

        $collection = Mage::getResourceModel('catalog/product_collection')

                array('aggregation' => $collection->getResource()->getTable('sales/bestsellers_aggregated_monthly')),
                "e.entity_id = aggregation.product_id AND aggregation.store_id={$storeId} AND aggregation.period BETWEEN '{$fromDate}' AND '{$toDate}'",
                array('SUM(aggregation.qty_ordered) AS sold_quantity')
            ->order(array('sold_quantity DESC', 'e.created_at'));


        return $collection;

Now I try to get the rating summary with the following code in my PHTML block:

<?php foreach ($this->getBestsellerProducts() as $_product): ?>
    <?php if($_product->getRatingSummary()): ?>
        <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
    <?php endif; ?>
<?php endif; ?>

Unfortunately the summary stays empty. How I can get this information?


Add this line before return $collection

  • I am getting same issue in magento 2. Can anyone have solution for this? – Shomita May 6 '19 at 10:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.