I have added 3 extra field in review form
just go to the frontend\base\default\template\review/form.phtml
add three field as other text field.
now go to 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(), //this field add by sourav
'fname' => $object->getFname(), //this field add by sourav
'lname' => $object->getLname(), //this field add by sourav
);
now add email,fname,lname 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( //this field add by sourav
'label' => Mage::helper('review')->__('First Name'),
'required' => true,
'name' => 'fname'
));
$fieldset->addField('lname', 'text', array( //this field add by sourav
'label' => Mage::helper('review')->__('Last Name'),
'required' => true,
'name' => 'lname'
));
$fieldset->addField('email', 'text', array( //this field add by sourav
'label' => Mage::helper('review')->__('Email'),
'required' => true,
'name' => 'email'
));
before
$fieldset->addField('nickname', 'text', array(
'label' => Mage::helper('review')->__('Nickname'),
'required' => true,
'name' => 'nickname'
));
No comments:
Post a Comment