I have this problem.

I send the email from http://www.chocolate-shop.it/it/contatti

but the page of return is /contacts/index/post

i can to modify the response page?

where is this page /contacts/index/post

how modify it?

1 Answer 1


In order to fulfill,your requirement,need to modify code of controller class Mage_Contacts_IndexController on function postAction()

which written at app/code/core/Mage/Contacts/controllers/IndexController.php.

So require to override this controller class. You need change all to

Override controller code is look like:

require_once Mage::getModuleDir('controllers', "Mage_Contacts").DS."IndexController.php";
class [ModuleNameSpace]_[ModuleName]_IndexController extends Mage_Contacts_IndexController
    public function newAction()


        $post = $this->getRequest()->getPost();
        if ( $post ) {
            $translate = Mage::getSingleton('core/translate');
            /* @var $translate Mage_Core_Model_Translate */
            try {
                $postObject = new Varien_Object();

                $error = false;

                if (!Zend_Validate::is(trim($post['name']) , 'NotEmpty')) {
                    $error = true;

                if (!Zend_Validate::is(trim($post['comment']) , 'NotEmpty')) {
                    $error = true;

                if (!Zend_Validate::is(trim($post['email']), 'EmailAddress')) {
                    $error = true;

                if (Zend_Validate::is(trim($post['hideit']), 'NotEmpty')) {
                    $error = true;

                if ($error) {
                    throw new Exception();
                $mailTemplate = Mage::getModel('core/email_template');
                /* @var $mailTemplate Mage_Core_Model_Email_Template */
                $mailTemplate->setDesignConfig(array('area' => 'frontend'))
                        array('data' => $postObject)

                if (!$mailTemplate->getSentSuccess()) {
                    throw new Exception();


                Mage::getSingleton('customer/session')->addSuccess(Mage::helper('contacts')->__('Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.'));
               // $this->_redirect('*/*/');

            } catch (Exception $e) {

                Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later'));

        } else {


and config.xml code :

                        <customcontacts before="Mage_Contacts">[ModuleNameSpace]_[ModuleName]</customcontacts>

For How to override a controller in Magento checkout this link

  • I can not to modify only the page /contacts/index/post? Oct 9, 2015 at 13:29
  • yes..you can do then it does not follow magento standard
    – Amit Bera
    Oct 9, 2015 at 13:30
  • if I would only remove the side menu into this page? Oct 9, 2015 at 13:36

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.