2013-01-10 146 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

相關問題