magento 购物车 首页 显示

如何将购物车显示在你的首页

 

1.复制代码:<!--new block -->
                <block type="checkout/cart_sidebar" name="cart_sidebar" as="topcart" template="checkout/cart/sidebar.phtml"/>

带page.xml 文件中(大约69行);效果:

<block type="page/html_header" name="header" as="header">
                <block type="page/template_links" name="top.links" as="topLinks"/>
                <block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
                <block type="core/text_list" name="top.menu" as="topMenu"/>
                <!--new block -->
                <block type="checkout/cart_sidebar" name="cart_sidebar" as="topcart" template="checkout/cart/sidebar.phtml"/>

                <block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
                    <label>Page Header</label>
                    <action method="setElementClass"><value>top-container</value></action>
                </block>
            </block>

 

2.header.phtml 在该文件中调用你的购物车信息:

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

 

3. 可以省略(更新block。到后台 CMS => Manage Pages ,找到首页cms,进入找到Custom Design 选项,在Layout Update XML 里面填写以下代码:<referencename="header">
<actionmethod="unsetChild"><name>cart_sidebar</name></action>
</reference>)

 

4.没得了

posted on 2015-05-20 09:54  互联网+  阅读(329)  评论(0编辑  收藏  举报