magento - magento 中 local.xml 的更新似乎很重要

标签 magento

如何解决?我希望“我的购物车”链接不在顶部菜单中,而是在其他位置。所以我从 checkout.xml 中删除:

<reference name="top.links">
    <block type="checkout/links" name="checkout_cart_link">
        <action method="addCheckoutLink"></action>
    </block>
</reference>

然后添加新引用:

<reference name="top.mybasket">
    <block type="checkout/links" name="checkout_cart_link">
        <action method="addCartLink"></action>
    </block>
</reference> 

从 page.xml 我添加以下内容:

    <block type="page/html_header" name="header" as="header">
                <block type="page/template_links" name="top.links" as="topLinks"/>
// other blocks
                <block type="page/template_links" name="top.mybasket" as="my_basket_count"/>
</block> 

接下来我在 header.phtml 中添加:

<?php echo $this->getChildHtml('my_basket_count') ?> 

一切正常。 我的问题是如何在 local.xml 中完成整个过程?我尝试过,但看起来很关键!

最佳答案

如果我正确理解您的要求,这里是您需要的 local.xml 的内容:

<?xml version="1.0"?>
<layout version="0.1.0">
 <default>
  <reference name="top.links">
   <remove name="checkout_cart_link"/>
  </reference>
  <reference name="root">
   <reference name="header">
    <block type="page/template_links" name="top.mybasket" as="my_basket_count"/>
   </reference>
  </reference>
  <reference name="top.mybasket">
   <block type="checkout/links" name="checkout_cart_link">
    <action method="addCartLink"></action>
   </block>
  </reference>
 </default>
</layout>

关于magento - magento 中 local.xml 的更新似乎很重要,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6159525/

相关文章:

magento 这封信不能仅针对特定邮件发送

api - Magento API - 从特定类别获取产品名称

php - 用于 javascript 的 magento 转义字符串

web - Magento:设置刚刚创建的网站的配置值?

Magento:导出属性

magento - 如何在 Magento 1.6 中更改客户发票模板

css - 在 Magento 中为单个页面插入 css 引用的最佳方法

magento - wamp tmp文件夹在本地运行magento时占用一些GB空间

magento - 在 Magento 中,我无法上传产品中的图片

magento - Magento 1.4 中按类别过滤