【问题标题】:Magento logout button vanishes on Order tracking pageMagento 注销按钮在订单跟踪页面上消失
【发布时间】:2013-06-07 06:50:44
【问题描述】:

top.links 中的登录/注销链接显示在任何地方,除了 Magento 的标准订单跟踪页面。我已经用默认值替换了 customer.xml,但它不能解决问题。登录和注销链接都不会显示在该页面上。所有其他链接都显示正常。我无法找到解决此问题的方法。有人吗?

谢谢

【问题讨论】:

    标签: magento layout magento-1.7


    【解决方案1】:

    在您的自定义设置中很困难,所以我只是试图让您朝着正确的方向前进:

    获取您当前的布局句柄,也许您将这一行添加到控制器或任何活动代码中,以获取您页面的活动句柄:

    Zend_Debug::dump(Mage::app()->getLayout()->getUpdate()->getHandles());
    

    检查布局xml文件中的每个活动布局句柄,也许链接被删除 如果它没有被删除,它可能根本没有被添加。

    通过 layout-xml-file 移除的方法:

    <reference name="top.links">
                <action method="removeLinkByUrl">
                    <url helper="customer/getLoginUrl" />
                </action>
    </reference>
    

    通过layout-xml-file添加方式:

    <action method="addLink" translate="label title" module="customer">
      <label>Log In</label>
      <url helper="customer/getLoginUrl"/>
      <title>Log In</title>
      <prepare/>
      <urlParams/>
      <position>100</position>
    </action>
    

    希望这会有所帮助!

    【讨论】:

    • 感谢您的快速回答。在任何 xml 文件中都找不到 removeLinkByUrl!所以它没有被删除。而且我知道它被添加到块 top.links 下的 customer.xml 中,还有其他的吗?
    • 您是否调试过活动布局句柄...以检查链接是否添加到正确的句柄中?
    • 它位于 customer_logged_in 和 customer_logged_out 句柄中,因此无论客户是否登录,它都应显示在所有页面中。是的,我调试了。
    猜你喜欢
    • 2014-07-13
    • 1970-01-01
    • 1970-01-01
    • 2015-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-15
    • 1970-01-01
    相关资源
    最近更新 更多