我在产品管理的 Magento 管理员中添加了一个新选项卡来查看 ERP 数据。添加了以下文件:
class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Erp extends Mage_Adminhtml_Block_Widget
{
public function __construct()
{
parent::__construct();
$this->setProduct($this->getProduct());
$this->setTemplate('Purchase/Product/Edit/Tab/SupplyNeedsSummary.phtml');
}
/**
* Return current product instance
*
* @return Mage_Catalog_Model_Product
*/
public function getProduct()
{
return Mage::registry('product');
}
}
和...
class MDN_AdvancedStock_Block_Adminhtml_Catalog_Product_Edit_Tab_Erp extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Erp {
protected function _toHtml() {
return parent::_toHtml();
}
}
我编辑了文件 Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs 并添加(大约第 85 行):
$this->addTab('erp', array(
'label' => Mage::helper('catalog')->__('ERP Samenvatting'),
'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_erp')->toHtml(),
));
一切正常,数据显示。但是,标签菜单的 HTML 现在由于某种原因搞砸了。当我查看源代码时,我看到的是:
<li>
<a class="tab-item-link" title="Voorraad" name="inventory" id="product_info_tabs_inventory" href="#">
<span><span title="The information in this tab has been changed." class="changed"/><span title="This tab contains invalid data. Please solve the problem before saving." class="error"/>Voorraad</span>
</a>
</li>
<li>
<a class="tab-item-link active" title="ERP Samenvatting" name="erp" id="product_info_tabs_erp" href="#">
<span><span title="The information in this tab has been changed." class="changed"/><span title="This tab contains invalid data. Please solve the problem before saving." class="error"/>ERP Samenvatting</span>
</a>
</li></ul></div>
<li>
<a class="tab-item-link ajax notloaded" title="Categorieën" name="categories" id="product_info_tabs_categories" href="http://www.sicomputers.nl/index.php/login/catalog_product/categories/id/23532/key/3fd54077f0c85aa69c3383ccb4f0e7cb/">
<span><span title="The information in this tab has been changed." class="changed"/><span title="This tab contains invalid data. Please solve the problem before saving." class="error"/>Categorieën</span>
</a>
<div style="display: none;" id="product_info_tabs_categories_content"/>
</li>
如您所见,在 ERP 选项中,出于某种原因,包括关闭 UL 和 DIV。有谁知道为什么会这样。请注意,这篇文章中提到了我所做的所有更改。没有进行其他更改。
提前致谢。