I want to open new window when I click "Add Product" button in Catalog->Manage Products
grid.
I want to enter new product details in new window not in existing window.
How to do that in Magento..?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityYou can do it by
File path:
magento/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php
protected function _prepareLayout()
{
$this->_addButton('add_new', array(
'label' => Mage::helper('catalog')->__('Add Product'),
'onclick' => "setLocation('{$this->getUrl('*/*/new')}')",
'class' => 'add'
));
$this->setChild('grid', $this->getLayout()->createBlock('adminhtml/catalog_product_grid', 'product.grid'));
return parent::_prepareLayout();
}
Create a file and Replace function to:
magento/app/code/local/Mage/Adminhtml/Block/Catalog/Product.php
protected function _prepareLayout()
{
$this->_addButton('add_new', array(
'label' => Mage::helper('catalog')->__('Add Product'),
'onclick' => 'window.open(\''.$this->getUrl('*/*/new').'\')',
'class' => 'add'
));
$this->setChild('grid', $this->getLayout()->createBlock('adminhtml/catalog_product_grid', 'product.grid'));
return parent::_prepareLayout();
}
replace 'window.open(\''.$this->getUrl('*/*/new').'\')'
Enjoy :)