I am looking forward to create a custom fields 'Email Id' & One drop-down in Review form .
I have tried this one but not saving the data, its hows the fields only
app\code\core\Mage\Review\Model\Mysql4\Review.php
protected function _afterSave(Mage_Core_Model_Abstract $object)
{
$detail = array(
'title' => $object->getTitle(),
'detail' => $object->getDetail(),
'nickname' => $object->getNickname(),
'email' => $object->getEmail(), // New field 1
'fname' => $object->getFname(), // New field 2
);
Now add email,fname in the review_detail table in the database also go to app\code\core\Mage\Adminhtml\Block\Review\Edit\Form.php also add :
$fieldset->addField('fname', 'text', array( // New field 2
'label' => Mage::helper('review')->__('First Name'),
'required' => true,
'name' => 'fname'
));
$fieldset->addField('email', 'text', array( // New field 1
'label' => Mage::helper('review')->__('Email'),
'required' => true,
'name' => 'email'
));
before to
$fieldset->addField('nickname', 'text', array(
'label' => Mage::helper('review')->__('Nickname'),
'required' => true,
'name' => 'nickname'
));
Finally i have solved it... Open app\code\core\Mage\Review\Model\Resource\Review.php
you will find this code in line about 150
Add the new two fields you want to add.
Thats it no more.... :) Happy coding
Modify the Mage core class is a bit scary, which will be difficult to upgrade magento core class in the future. You can override the specific class by your own custom module (See module creator if you want to setup one)
Module's config.xml, add the models rewrite in as below:
And the specified class will extend from the Magento core class you want to override:
Ps. to add the new field in magento review_detail table: