Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8993153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:07:48+00:00 2026-06-15T23:07:48+00:00

We have build a custom Magento module for contact inquiries in our webshop. Please

  • 0

We have build a custom Magento module for contact inquiries in our webshop.

Please see the IndexController below. We would like to change the redirect route per store view. How we can achieve this?

<?php
class MVE_ContactInquiry_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        $block = $this->getLayout()->createBlock(
            'Mage_Core_Block_Template',
            'mve.contact_inquiry',
            array(
                'template' => 'mve/contact_inquiry.phtml'
            )
        );
        $this->getLayout()->getBlock('content')->append($block);
        //$this->getLayout()->getBlock('right')->insert($block, 'catalog.compare.sidebar', true);
        $this->_initLayoutMessages('core/session');
        $this->renderLayout();
    }
    public function sendemailAction()
    {

        $params = $this->getRequest()->getParams();
        $mail = new Zend_Mail();       
        $bodytext = '
            Naam: ' . $params['name'] . '
            E-mailadres: ' . $params['email'] . '
            Telefoonnummer: ' . $params['telephone'] . '
            Bericht:
            ' . $params['comment'];
        $mail->setBodyText( $bodytext );

        $mail->setFrom($params['email'], $params['name']);
        $mail->addTo('example@gmail.com');
        $mail->setSubject('Contact aanvraag');
        try {
            $mail->send();
        }
        catch(Exception $ex) {
            Mage::getSingleton('core/session')->addError('Unable to send email.');
        }

        $this->_redirect('contact/bedankt');
    }
}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:07:49+00:00Added an answer on June 15, 2026 at 11:07 pm

    Option 1

    In /app/code/local/MVE/ContactInquiry/etc/system.xml

    Assuming that you want to create your own Tab in the left nav

    <?xml version="1.0"?>
    <config>
        <tabs>
            <mve_tab translate="label" module="contactinquiry">
                <label>MVE</label>
                <sort_order>900</sort_order>
            </mve_tab>
        </tabs>
        <sections>
            <contactinquiry translate="label" module="contactinquiry">
                <label>Admin Order Confirmation</label>
                <tab>mve_tab</tab>
                <sort_order>1001</sort_order>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>1</show_in_store>
                <groups>
                    <general_option translate="label">
                        <label>General Options</label>
                        <frontend_type>text</frontend_type>
                        <sort_order>1</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                        <fields>
                            <redirect_url translate="label">
                                <label>URL </label>
                                <frontend_type>text</frontend_type>
                                <sort_order>1</sort_order>
                                <show_in_default>1</show_in_default>
                                <show_in_website>1</show_in_website>
                                <show_in_store>1</show_in_store>
                            </redirect_url>
                        </fields>
                    </general_option>
                </groups>>
            </contactinquiry>
        </sections>
    </config>
    

    To get the value in you controller you do

    Mage::getStoreConfig(‘contactinquiry/general_option/redirect_url’, Mage::app()->getStore()->getId())

    see XML for Admin Configurations for more help

    Option 2

    if(Mage::app()->getStore()->getStoreId() == 1){
        $this->_redirect('contact/...');
    }
    else if(Mage::app()->getStore()->getStoreId() == ...){
        $this->_redirect('contact/..');
    }
    else{
        $this->_redirect('contact/bedankt');
    }
    

    Option 3

    You could also add a hidden field in each form which contain the url to redirect to

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom class that I use to build table strings. I would
I'm using nant to build our product and have written a custom task to
I have this route that let me build custom url for users like /thisismyname,
I would like to build custom tab menu on top of the screen, similar
I have build a custom component in JSF 2.0 The tag looks like this:
As part of a custom ant build I'm toying with I'd like to have
I have to build a custom module in which i have added a custom
I have a custom build target in a visual studio 2008 c# project. Is
I have a custom build of a Unix OS. My task: Adding an IPSec
For reference, I'm using Visual Studio 2010. I have a custom build step defined

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.