如何在magento中调用页脚迷你车?

时间:2016-03-18 07:02:40

标签: magento

我想在页脚中调用迷你购物车。 我必须在xml文件中使用以下代码

<reference name="footer">
     <block type="checkout/cart_sidebar" name="footer_cart" template="checkout/cart/topcart.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>
footer.phtml中的

<?php echo $this->getChildHtml('top_cart') ?>。 但它不适合我。请给我任何想法。

1 个答案:

答案 0 :(得分:1)

你的名字是footer_cart所以

更改

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

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

其他问题是你正在调用错误的文件

更改

<block type="checkout/cart_sidebar" name="footer_cart" template="checkout/cart/topcart.phtml" before="-">

<block type="checkout/cart_sidebar" name="footer_cart" template="checkout/cart/sidebar.phtml" before="-">