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

2
41
views
Advertisement

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

2 COMMENTS