2

How can I add new status for reviews?

I want to do that from installer.

My code is kinda like this:

$sql = "INSERT INTO `review_status` (`status_code`) VALUES ('Approved And Verified');
";

try {
    $conn = Mage::getSingleton('core/resource')->getConnection('core_write');
    $conn->query($sql);
} catch (Exception $e){
    echo $e->getMessage();
}

The status is added in database but not usable/seen in admin in order to change a review status.

Thanks in advance.

1 Answer 1

1

The part from installer was good but also i needed to rewrite Helper and Model for Mage_Review:

class Custom_Review_Helper_Data extends Mage_Review_Helper_Data
{
    public function getReviewStatuses()
    {
        return array(
            Mage_Review_Model_Review::STATUS_APPROVED                       => $this->__('Approved'),
            Mage_Review_Model_Review::STATUS_PENDING                        => $this->__('Pending'),
            Mage_Review_Model_Review::STATUS_NOT_APPROVED                   => $this->__('Not Approved'),
            Custom_Review_Model_Review::STATUS_APPROVED_AND_VERIFIED        => $this->__('Approved And Verified')
        );
    }
}



class Custom_Review_Model_Review  extends Mage_Review_Model_Review {

    const STATUS_APPROVED_AND_VERIFIED  = 4;

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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