Question

How to get Magento product reviews of status APPROVED and/or PENDING?

None of these attempts work. Anyone know how to achieve this?

$reviews = Mage::getModel('review/review')->getResourceCollection();
$reviews->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED && STATUS_PENDING)

or:

$reviews = Mage::getModel('review/review')->getResourceCollection();
$reviews->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED && Mage_Review_Model_Review::STATUS_PENDING)

or:

$reviews = Mage::getModel('review/review')->getResourceCollection();
$reviews->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED || Mage_Review_Model_Review::STATUS_PENDING)

What is the correct syntax to filter both Approved and Pending reviews?

So all reviews but excluding STATUS_NOT_APPROVED reviews

Was it helpful?

Solution

below code is correct

$reviews = Mage::getModel('review/review')->getResourceCollection();
$reviews->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED || Mage_Review_Model_Review::STATUS_PENDING)
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top