dongsi1944 2016-01-21 20:32
浏览 45

magento在注册块中单击提交按钮后重定向自定义cms页面

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

  • 写回答

1条回答 默认 最新

  • dongli5785 2016-01-22 07:15
    关注

    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

    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料