user3048768
user3048768

Reputation: 1

Magento: get all reviews on one page via .phtml

i don't find answer to my specific question:

i need get all reviews via .phtml

this code work perfect:

echo $this->getLayout()->createBlock('review/customer_list')->setTemplate('review/customer/list.phtml')->toHtml();

but if customer is logged in, code shows all his reviews...if customer is logout - it's shows There no reviews (all ok)

i need shows review for all products has review.

help

Upvotes: 0

Views: 6343

Answers (2)

MageZeus
MageZeus

Reputation: 184

You probably can make use of the Rating Model, it has a getCollection support so it should be easy as this:

$reviews = Mage::getModel('rating/rating')->getCollection();
// Some filtering maybe...

There is also a function called getReviewSummary which gives you anything you want

Dig depper into that and you will find the answer hopefully

Upvotes: 1

Rajiv Ranjan
Rajiv Ranjan

Reputation: 1869

There are some free extension available to show review on CMS page. like:http://www.magentocommerce.com/magento-connect/all-reviews-3122.html

OR

If you want to add review on some specific page then you can for custom code.

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

Hope will help!

Upvotes: 1

Related Questions