我已尝试在magento中编辑新的客户帐户确认模板。但它不会在前端反映出来。
我已经在主题布局文件夹的customer.xml文件中编辑了customer_account_confirmation的布局。
我已经在customer.xml中编辑了customer_account_confirmation
<customer_account_confirmation>
<remove name="right"/>
<remove name="left"/>
<reference name="root">
<action method="setTemplate"><template>page/account_confirm.phtml</template></action>
<action method="setHeaderTitle" translate="title" module="customer"><title>Send confirmation link</title></action>
</reference>
</customer_account_confirmation>当我尝试单击邮件中的确认链接时,它会重定向到仪表板页面并显示确认消息。但我需要从邮件中显示客户单击确认链接后的感谢页面
我想在模板folder.But中的account_confirm.phtml文件中设置感谢页,但这不起作用。
能给我推荐一个解决这个问题的正确方案吗?
谢谢
发布于 2013-05-23 06:15:47
如果我没弄错的话,您的问题是:如何更改当客户单击其新帐户的确认链接时调用的重定向URL?
在这种情况下,检查负责默认重定向(到“仪表板”)的控制器。您可以通过检查确认链接中给出的URL很容易找到它,它类似于http://www.yourdomain.com/customer/account/confirm/[some params]。从这里您可以获得控制器:您正在寻找位于Customer模块的AccountController.php中的confirmAction()方法。在此方法的末尾,定义了一个重定向:
public function confirmAction() {
(...)
// log in and send greeting email, then die happy
$this->_getSession()->setCustomerAsLoggedIn($customer);
$successUrl = $this->_welcomeCustomer($customer, true);
$this->_redirectSuccess($backUrl ? $backUrl : $successUrl);
return;
(...)
}因此,在成功确认时,用户被重定向到$backUrl中给定的URL,或者,如果没有给出,则被重定向到$successUrl中给定的URL。
如果确认链接$backUrl包含参数back_url,则在此confirmAction()方法内定义第一个变量back_url
$backUrl = $this->getRequest()->getParam('back_url', false);
第二个变量$succesUrl由AccountController的_welcomeCustomer()方法返回,该方法设置指向indexAction()的URL,加载客户的仪表板。
因此,为了更改默认的Magento重定向,您可以确保您的确认链接是使用back_url参数创建的(例如,在我的示例中,此参数为空);或者您可以覆盖自定义模块中的AccountController并根据需要进行重定向。
https://stackoverflow.com/questions/11610596
复制相似问题