Saturday 15 May 2010

contact form coming error in magento 1.8.1 how to solve? -



contact form coming error in magento 1.8.1 how to solve? -

we new in magneto , facing problem issue contact page not working when fill form , submit coming error 'unable submit request. please seek 1 time again later' do? kindly help me. link http://under555.com/contact_us

the contacts form submit controller,

app/code/core/mage/contacts/controllers/indexcontroller.php

this like,

public function postaction() { $post = $this->getrequest()->getpost(); if ( $post ) { $translate = mage::getsingleton('core/translate'); /* @var $translate mage_core_model_translate */ $translate->settranslateinline(false); seek { $postobject = new varien_object(); $postobject->setdata($post); $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')) ->setreplyto($post['email']) ->sendtransactional( mage::getstoreconfig(self::xml_path_email_template), mage::getstoreconfig(self::xml_path_email_sender), mage::getstoreconfig(self::xml_path_email_recipient), null, array('data' => $postobject) ); if (!$mailtemplate->getsentsuccess()) { throw new exception(); } $translate->settranslateinline(true); mage::getsingleton('customer/session')->addsuccess(mage::helper('contacts')->__('your enquiry submitted , responded possible. give thanks contacting us.')); $this->_redirect('*/*/'); return; } grab (exception $e) { $translate->settranslateinline(true); mage::getsingleton('customer/session')->adderror(mage::helper('contacts')->__('unable submit request. please, seek 1 time again later')); $this->_redirect('*/*/'); return; }

here can error message @ last. go , check file can find problem. error caused hideit input field. may enable validation field in same file

if (!zend_validate::is(trim($post['hideit']), 'notempty')) { $error = true; }

if find 1 comment out or replace below one,

if (zend_validate::is(trim($post['hideit']), 'notempty')) { $error = true; }

that's it. if have uncertainty please comment here.

magento magento-1.8

No comments:

Post a Comment