1

I have multiple Magento stores setup and have a custom theme for each store.

For the additional sub-store, the contact page is sending the email, but it is redirecting back to the main store instead on submit.

http://store1.com/store2/contacts

It sends email and then redirects to the other store

http://store1.com/index.php/contacts/index

Are there any fixes for this without editing the core contacts IndexController.php?

From contacts/form.phtml:

<form action="http://store1.com/store2/contacts/index/post/" id="contactForm" method="post">
  • have you right static url in form action? – Keyul Shah Mar 21 '14 at 16:55
  • I have no experience with multistores, but how do you set the right store or store view? The redirect method, which is called in the IndexController, gets the BaseUrl, so if the right store is set everything should work fine. – smiggle Mar 21 '14 at 17:50
1

Have a look at the Mage_Contacts_IndexController::postAction check the following lines:

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('*/*/');

Here is adds the success message and then sets up the redirect. I guess that the problem is not specifically with the contact controller but with the way Magento sets up it's urls.

Maybe you can debug the getUrl function

public static function getUrl($route = '', $params = array())
{
    return self::getModel('core/url')->getUrl($route, $params);
}

And see if there is anything with your set-up that is causing the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.