Change user position of product tab in Magento admin grid

Hi, I added a new product tab to the admin grid by following the link below

http://inchoo.net/magento/how-to-add-custom-product-relations-in-magento/

Everything is working fine. BUt this added a new tab to the last position in the product editing section. Can you suggest me how I can reposition this tab.

thank

+4
source share
2 answers

You can use the action addTabAfterinstead addTab, then you must specify the parameter <after>(categories, websites, upsell ...).

I edited your tutorial code, for example:

<reference name="product_tabs">
    <action method="addTabAfter">
        <name>custom</name>
        <block>inchoo_customlinkedproducts/adminhtml_catalog_product_edit_tab</block>
        <after>upsell</after>
    </action>
</reference>

Hope this is enough for you.

+1
source

, JavaScript.

JavaScript

  <adminhtml_catalog_product_edit>
    <reference name="head">
      <action method="addJs">
        <script>jsoveride/accesorytab.js</script>
      </action>
    </reference>
  </adminhtml_catalog_product_edit>
  <adminhtml_catalog_product_new>
    <reference name="head">
      <action method="addJs">
        <script>jsoveride/accesorytab.js</script>
      </action>
    </reference>
  </adminhtml_catalog_product_new>

,

document.observe("dom:loaded", function() {
document.getElementById("product_info_tabs_crosssell").appendChild(document.getElementById("product_info_tabs_custom"));      
        });       

.

- , , .

0

All Articles