Home > Magento > Add email field to review form

1. Add email field to review_detail table
ALTER TABLE review_detail ADD COLUMN email VARCHAR(255) NULL;

2. Add email field to app/design/frontend/idstore/default/template/review/form.phtml

3. Edit app/code/core/Mage/Review/Model/Resource/Review.php

protected function _afterSave(Mage_Core_Model_Abstract $object) {
$detail = array(
'title' => $object->getTitle(),
'detail' => $object->getDetail(),
'nickname' => $object->getNickname(),
'email' => $object->getEmail(), // add this line
);
}

4. Edit app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php

Add the below code:

$fieldset->addField('email', 'text', array(
'label' => Mage::helper('review')->__('Email'),
'required' => true,
'name' => 'email'
));

before to:

$fieldset->addField('email', 'text', array(
'label' => Mage::helper('review')->__('Email'),
'required' => true,
'name' => 'email'
));

Reference:
http://www.magentocommerce.com/boards/v/viewthread/264533/#t484885



Flag Counter