1

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..?

0
1

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

2
  • This is what exactly I need. it's working perfect. Thank you @Nikunj Vadariya.. Jun 7 '18 at 7:11
  • Happy to help dear! Jun 7 '18 at 7:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.