How to add new tab in left panel, when add new product in admin panel?

Posted: August 6, 2009 in Magento, Version 1.3.*

For Above subject,

1. ) First create Newtab.php

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab

content of this file looks something like this

<?php

class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Newtab extends Mage_Adminhtml_Block_Widget_Form {
public function __construct()
{
parent::__construct();
$this->setTemplate(‘catalog/product/edit/tab/newtab.phtml’);
}

protected function _prepareLayout()
{

return parent::_prepareLayout();
}

public function initForm(){

$form = new Varien_Data_Form();
return $this;
}

}
?>

2 ) Create a file newtab.phtml
/var/www/magento/app/design/adminhtml/default/default/template/catalog/product/tab

content of this file is

<div>

New Tab File Content

</div>

3) the important step is adding the tab

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab.php

$this->addTab(’addresses’, array(
‘label’ => Mage::helper(’customer’)->__(’New Tab’)
, ‘content’ => $this->getLayout()->createBlock(’adminhtml/customer_edit_tab_newtab’)->initForm()->toHtml(),
));

– Jinesh Soni
Comments
  1. atwix says:

    Hi! Thanks for the great information, it’s very useful. We have an article on the similar topic posted here http://www.atwix.com/magento/new-tab-product-edit-page/ you are welcome to check it out and leave your feedback

  2. Hi Jinesh,
    actually i want to open grid in second tab. basically i have a module where all information are showing if i click on that than edit form has opened. on edit page i want to add one more tab where i want to display grid in ajax .

Leave a reply to atwix Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.