简体   繁体   中英

magento redirect custom cms page after clicking submit button in register block

I like to redirect the page after clicking the submit button inside register block, directory as follow.

frontend/base/default/template/customer/form/register.phtml

It is currently linked to "MY DASHBOARD" page, url such as domain.com/index.php/customer/account . How do we link this page to some other custom CMS page?

Is it somewhere inside Mage/Cutomer/Block?


updates: It is inside AccountController.php, directory as follow

app->core->code->Mage->customer->controllers->AccountController.php

line 530:

protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
    {
        $this->_getSession()->addSuccess(
            $this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName())
        );
        if ($this->_isVatValidationEnabled()) {
            // Show corresponding VAT message to customer
            $configAddressType =  $this->_getHelper('customer/address')->getTaxCalculationAddressType();
            $userPrompt = '';
            switch ($configAddressType) {
                case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING:
                    $userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you shipping address for proper VAT calculation',
                        $this->_getUrl('customer/address/edit'));
                    break;
                default:
                    $userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you billing address for proper VAT calculation',
                        $this->_getUrl('customer/address/edit'));
            }
            $this->_getSession()->addSuccess($userPrompt);
        }

        $customer->sendNewAccountEmail(
            $isJustConfirmed ? 'confirmed' : 'registered',
            '',
            Mage::app()->getStore()->getId()
        );

        $successUrl = $this->_getUrl('*/*/index', array('_secure' => true));
        if ($this->_getSession()->getBeforeAuthUrl()) {
            $successUrl = $this->_getSession()->getBeforeAuthUrl(true);
        }
        return $successUrl;
    }

I replace this line

$successUrl = $this->_getUrl('*/*/index', array('_secure' => true));

with this

$successUrl = Mage::getBaseUrl()

and the page goes to my homepage.

What if I like to go to url domain.com/coupon-spring2016 aka my custom cms page. Thank you

You have the answer here:

https://stackoverflow.com/a/25711352

You need create observer:

customer_register_success

And redirect to cms or where you want

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM