2012-02-29 4 views
1

제품 관리의 Magento 관리자에게 새 탭을 추가하여 ERP 데이터를 확인했습니다.Magento - Added Tab은 닫기 ul 및 div를 포함하는 Option 메뉴를 제공합니다.

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 어떤 이유로 포함되어 있습니다 : 나는 소스 코드에 보면이 내가 볼 것입니다. 누가 이런 일이 일어나고 있는지 알고 있습니다. 제가 작성한 모든 변경 사항은이 게시물에 언급되어 있습니다. 다른 변경 사항은 없습니다.

미리 감사드립니다.

답변

0

코어 파일을 편집하지 마십시오. 새 탭을 추가하려면 레이아웃 업데이트를 사용해야합니다. 번들 제품의 경우 어떻게 수행되는지 확인하십시오.

<adminhtml_catalog_product_bundle> 
    <reference name="product_tabs"> 
     <action method="addTab"><name>bundle_items</name><block>bundle/adminhtml_catalog_product_edit_tab_bundle</block></action> 
     <action method="bindShadowTabs"><first>bundle_items</first><second>customer_options</second></action> 
    </reference> 
</adminhtml_catalog_product_bundle>