简体   繁体   English

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

[英]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 . 它当前链接到“ MY DASHBOARD”页面,URL如domain.com/index.php/customer/account How do we link this page to some other custom CMS page? 我们如何将该页面链接到其他自定义CMS页面?

Is it somewhere inside Mage/Cutomer/Block? 它在法师/法师/方块/方块里面吗?


updates: It is inside AccountController.php, directory as follow 更新:它位于AccountController.php中,目录如下

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

line 530: 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. 如果我想转到url domain.com/coupon-spring2016又名我的自定义cms页面怎么办。 Thank you 谢谢

You have the answer here: 您在这里有答案:

https://stackoverflow.com/a/25711352 https://stackoverflow.com/a/25711352

You need create observer: 您需要创建观察者:

customer_register_success 客户注册成功

And redirect to cms or where you want 并重定向到cms或您想要的位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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