0

我正在为 magento 创建一个自定义主题,但遇到了问题......

我希望购物车在购物时一直可见,所以我通过Local.xml

这是我使用的代码:

<reference name="left">
    <block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml" before="-">
        <action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
        <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
        <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
        <block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout">
            <label>Shopping Cart Sidebar Extra Actions</label>
        </block>
    </block>
</reference>

但问题是,当我登录该帐户时,该块会重复,如果我尝试通过Local.xml它删除它,则会同时删除...

如何删除默认块并始终启用自定义块?

查看图片以了解我的意思: 在此处输入图像描述

4

1 回答 1

0

将您自己的购物车块命名为与原来的不同(即 not cart_sidebar),因此它将始终显示并且您可以在<remove name="cart_sidebar" />不删除这两个块的情况下使用它。

于 2013-06-11T09:03:12.763 回答