how can i re-direct to a particular page after the user submits the contact form in Magento? form.phtml has
<form action="<?php echo Mage::getUrl(); ?>contacts/index/post/" id="contactForm" method="post">
but i'm not sure where to find the php file that controls the email sending and redirects. any ideas? thanks
EDIT: found this in IndexController.php under app > code > core > Mage > Contacts > controllers
$this->_redirect('*/*/');
I know its answered, just sharing my experience. I had made a contact form through a CMS page. The form worked fine. But after submitting it, it would redirect to the magento contact form. To redirect it back to CMS page, i had to put
$this->_redirect('contactus');
where contactus
is the URL identifier.
Also after redirect, the success / error message would not show up. For that i had to make changes here.
Go to /app/design/frontend/default/yourstore/template/contacts/form.phtml
<div id="messages_product_view">
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
</div>
with:
<?php Mage::app()->getLayout()->getMessagesBlock()->setMessages(Mage::getSingleton('customer/session')->getMessages(true)); ?>
I got the solution from here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With