2012-07-23 67 views
2

我试图编辑magento中的新客户账户确认模板。但它并不反映在前端。Magento新客户账户确认模板编辑

我在主题布局文件夹中的customer.xml文件中编辑了customer_account_confirmation的布局。

我在customer.xml

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

编辑customer_account_confirmation当我试图从点击邮件中的确认链接重定向到仪表板页面,并显示确认消息。 但我需要显示客户点击确认链接后,从邮件的谢谢页面

我想设置模板folder.conf中account_confirm.phtml文件的谢谢页面,但这是行不通的。

可以建议我正确的解决方案来解决这个问题吗?

感谢

+0

你有没有在测试之前清除缓存?另外,给一个Mage :: log account_confirm.phtml,它会让你知道这个模板文件是否被实际使用。 – Kalpesh 2012-07-23 10:45:13

+0

是的,我已禁用我的缓存和编译。点击链接后,它只重定向到帐户仪表板页面,并显示确认消息。 – 2012-07-23 11:12:05

+0

可能是文件中的错误。你可以发布你写的代码片段来显示点击链接的感谢页面吗? – Kalpesh 2012-07-23 11:31:30

回答

1

如果我得到你的权利,你的问题是:如何改变都会调用重定向URL当客户点击确认链接为她的新帐户上?

在这种情况下,请检查负责默认重定向的控制器(即“仪表板”)。您可以通过检查确认链接中提供的URL来轻松找到该链接,如http://www.yourdomain.com/customer/account/confirm/[some params]。从这里您可以得到控制器:您正在寻找confirmAction()方法,该方法位于Customer Modul的AccountController.php中。 在该方法的最后一个重定向被定义:

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,或者,如果此没有给出,以给定的URL在$successUrl

第一可变$backUrlconfirmAction()方法内被定义,如果确认链接URL包含一个参数back_url

$backUrl = $this->getRequest()->getParam('back_url', false);

第二可变$succesUrlAccountController_welcomeCustomer()方法,该方法设置返回一个指向indexAction()的URL,加载客户的仪表板。

因此,为了更改默认的Magento重定向,您可以确保您的确认链接是使用back_url参数创建的(在我的情况下,例如,此参数为空);或者您可以在自定义模块中覆盖AccountController并根据需要进行重定向。