繁体   English   中英

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

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

在单击注册块(目录)内的提交按钮后,我想重定向页面,如下所示。

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

它当前链接到“ MY DASHBOARD”页面,URL如domain.com/index.php/customer/account 我们如何将该页面链接到其他自定义CMS页面?

它在法师/法师/方块/方块里面吗?


更新:它位于AccountController.php中,目录如下

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

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;
    }

我替换这条线

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

有了这个

$successUrl = Mage::getBaseUrl()

然后页面转到我的主页。

如果我想转到url domain.com/coupon-spring2016又名我的自定义cms页面怎么办。 谢谢

您在这里有答案:

https://stackoverflow.com/a/25711352

您需要创建观察者:

客户注册成功

并重定向到cms或您想要的位置

暂无
暂无

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

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