2010-05-29
如何移动magneto右侧栏的购物车到顶部或者任何位置
栏目:magento模板美工
3,026 views
2 枚回复
想必很多朋友想在magento里把购物车移到顶部,或者在header 添加一个小型购物车。
如何能做到这样呢,当然有很多方法实现的。这里只需三步就能达到这种效果,下面是我的方法(这里以默认模板为例):
第一步:打开app\design\frontend\default\default\layout\page.xml
大概在58行处找到
1 | <block type="page/html_header" name="header" as="header"></block> |
在其sub-blocks 中 插入 购物车代码
1 2 3 4 5 6 7 | <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> |
第二步:打开文件app\design\frontend\default\default\template\page\html\header.phtml
1 | < ?php echo $this->getChildHtml('topcart'); ?> |
第三步:更新block。到后台 CMS => Manage Pages ,找到首页cms,进入找到Custom Design 选项,在Layout Update XML 里面填写以下代码:
1 2 3 | <reference name="header"> <action method="unsetChild"><name>cart_sidebar</name></action> </reference> |
就这样,小型购物车就完全的展现在magento顶部了。
标签: magento 移动购物车
转载注明:转自Topmagento.com|Magento技术交流站
本站遵循:署名-非商业性使用-禁止演绎 3.0 共享协议
收藏分享:
QQ书签 /
百度收藏 /
Google书签 /
收藏到鲜果 /
Digg /
Del.icio.us


要确保路径是正确的才行,上面路径是magento1.324版本默认模板路径, 1.4以及后面的版本默认模板路径是
app\design\frontend\base\default\layout
app\design\frontend\base\default\template
[回复]
完全按照这个步骤写了,但是还是没有显示。为什么呢?
[回复]