Question

I want to open new window when I click "Add Product" button in Catalog->Manage Products grid.

addproduct

I want to enter new product details in new window not in existing window.

How to do that in Magento..?

Was it helpful?

Solution

You 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 :)

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top