0
我想提出一個內部Magento的擴展,我想了幾個關鍵人物添加到客戶的概述,即/admin/customer/edit/id/XXX
頁:添加窗口小部件「客戶信息」後端頁
這怎麼能實現?我試過尋找知識庫等,但創建擴展的文檔似乎非常有限。
Magento版本是1.6.x.
我想提出一個內部Magento的擴展,我想了幾個關鍵人物添加到客戶的概述,即/admin/customer/edit/id/XXX
頁:添加窗口小部件「客戶信息」後端頁
這怎麼能實現?我試過尋找知識庫等,但創建擴展的文檔似乎非常有限。
Magento版本是1.6.x.
啓動模塊的最快方法是使用the module creator。其中它增加了將a config的文件,並認爲添加以下...
<config>
<!-- ...existing XML here... -->
<adminhtml>
<layout>
<updates>
<your_module_name>
<file>yourmodule.xml</file>
</your_module_name>
</update>
</layout>
</adminhtml>
</config>
這將導致加載app/design/adminhtml/default/default/layout/yourmodule.xml
文件,您可以向其中添加一個指令......
<layout>
<adminhtml_customer_edit>
<reference name="customer_edit_tab_view">
<block type="adminhtml/template" template="your/module/customer/view.phtml" name="your_module_view" />
</reference>
</adminhtml_customer_edit>
</layout>
和將在現有部分下面的客戶編輯頁面添加(最後部分,我保證)一個塊。它會告訴你必須創建和使用HTML,或許有點像這樣填補app/design/adminhtml/default/default/template/your/module/customer/view.phtml
內容...
<!-- Display a nice header around a box -->
<div class="entry-edit">
<div class="entry-edit-head"><h4><?php echo $this->__('Your Module Info') ?></h4></div>
<fieldset>
Your information will show here.
</fieldset>
</div>
</div>
這種方式是安全的,沒有升級可以覆蓋你的補充,因爲所有的文件路徑將會有你模塊名稱中的某處。
如何從該模板中訪問客戶ID? – phidah
您可以直接通過Mage :: registry('current_customer')'獲得客戶對象,並從中獲取所有屬性。 – clockworkgeek
如果要將管理控制檯添加到管理控制檯,是否適用同樣的原則?如果是這樣,我的配置文件將如何看? – phidah