2013-01-10 147 views
0

我忙于构建一个导航栏,其中包含用户菜单和购物车以及愿望清单,但试图弄清楚如何将其添加到xml模型中以使用getChildHtml功能。将购物车添加到Magento的top.menu

我对magento还是很陌生的,所以请和我一起裸照。

XML文件:page.xml

<block type="page/html_header" name="header" as="header"> 

我有

<block type="core/text_list" name="top.menu" as="topMenu" translate="label"> 

现在据我可以看到我必须包括以下某处或延长块或东西不是真的当然,请帮助我在正确的方向,甚至指向我的开发人员指南,将涵盖此。

<block type="checkout/cart_sidebar" name="cart_sidebar" as="topcart" template="checkout/cart/sidebar.phtml"/> 

谢谢。

回答

0

在你的主题文件夹中的应用程序/设计/前端/ your_package/your_theme /布局创建一个文件local.xml中/ 添加以下行并保存文件。

<layout version="0.1.0"> 
    <default> 
     <reference name="top.menu"> 
      <block type="checkout/cart_sidebar" name="cart_sidebar" as="topcart" template="checkout/cart/sidebar.phtml"/> 
     </reference> 
</default></layout> 

不要忘记在应用更改后清除magento缓存(系统 - >缓存管理)。

为了了解更多关于Magento块,布局,模板,有一个官方magento指南check it here

相关问题