Magento – All reviews on one page

review

How can I display all the reviews of the products on a single CMS page? I have found a module: http://www.magentocommerce.com/magento-connect/all-reviews.html, but it is nog compatible with 1.9.

enter image description here

Best Answer

Step1: You can get review Collection by below code:

$Collection=Mage::getModel('review/review')->getCollection()
                ->addStoreFilter(Mage::app()->getStore()->getId())
                ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
                ->addRateVotes()
                ->setDateOrder();

Step2: Create a Cms page from admin>Cms>Page> and at Design tab and put this code

<reference name="content">
<block type="core/template" name="review.form" template="catalog/allreview.phtml"/>
</reference>   

Step3: create allreview.phtml on app/design/frontend/your package/your template/templete/catalog/ and put below this phtml file you can put review details by below code:

<?php
    $_items = array_reverse( $Collection->getItems());

    foreach ($_items as $_review):
        $productId =  $_review->getentity_pk_value();
         $_review->getTitle();
         $_votes = $_review->getRatingVotes();
         $_review->getDetail()
          $this->formatDate($_review->getCreatedAt()) ?>
              $this->__('[Posted %s]', $this->formatDate($_review->getCreatedAt()), 'long');

    endforeach;
?>