У меня проблемы с получением нового модуля для работы. Для начала я просто хочу добавить дополнительную вкладку на экран редактирования продукта в adminhtml. Я хочу, чтобы эта вкладка отображалась под стандартной вкладкой «Пользовательские параметры». Мой модуль отображается в разделе «Конфигурация»> «Дополнительно»> «Дополнительно»> «Отключить модуль».
Так вот что я видел, видел ошибки?
Путь: приложение \ etc \ modules \ ns> _CustomerHistory.xml
<?xml version="1.0"?>
<config>
<modules>
<<ns>_CustomerHistory>
<active>true</active>
<codePool>local</codePool>
</<ns>_CustomerHistory>
</modules>
</config>
Путь: app \ code \ local \\ CustomerHistory \ etc \ config.xml
<?xml version="1.0"?>
<config>
<modules>
<<ns>_CustomerHistory>
<version>0.1.0</version>
</<ns>_CustomerHistory>
</modules>
<global>
<blocks>
<CustomerHistory>
<class><ns>_CustomerHistory_Block</class>
</CustomerHistory>
</blocks>
<models>
<CustomerHistory>
<class><ns>_CustomerHistory_Model</class>
</CustomerHistory>
</models>
</global>
<adminhtml>
<layout>
<updates>
<CustomerHistory>
<file>CustomerHistory.xml</file>
</CustomerHistory>
</updates>
</layout>
</adminhtml>
</config>
Путь: app \ code \ local \ ns> \ CustomerHistory \ Block \ Adminhtml \ Product \ Edit \ Tab.php
<?php
class <ns>_CustomerHistory_Block_Adminhtml_Catalog_Product_Edit_Tab extends Mage_Adminhtml_Block_Widget
implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
public function canShowTab()
{
return true;
}
public function getTabLabel()
{
return $this->_('Custom Tab');
}
public function getTabTitle()
{
return $this->_('Custom Tab');
}
public function isHidden()
{
return false;
}
public function getTabUrl()
{
return $this->getUrl('*/*/customtab', array('_current' => true));
}
public function getTabClass()
{
return 'ajax';
}
}
?>
Путь: app \ design \ adminhtml \ default \ default \ layout \ CustomerHistory.xml
<?xml version="1.0"?>
<layout>
<adminhtml_catalog_product_edit>
<reference name="product_tabs">
<block type="CustomerHistory/adminhtml_catalog_product_edit_tab" name="custom_tab" template="CustomerHistory/catalog/product/edit/tab.phtml" />
<action method="addTab">
<name>Custom Tab</name>
<block>custom_tab</block>
</action>
</reference>
</adminhtml_catalog_product_edit>
</layout>
Путь: app \ design \ adminhtml \ default \ default \ template \ CustomerHistory \ catalog \ product \ edit \ tab.phtml
<?php
/**
* Custom tab template
*/
?>
<div>
<h1>Hello</h1>
</div>
Само собой разумеется, любая помощь будет принята с благодарностью!
Задача ещё не решена.
Других решений пока нет …