0

I have added the new button in the order view page in the back-end, Now i want to when i click on the button my custom URL "www.google.com" page will open in the new window.

I am using the below code:

$this->_addButton('order_reorder', array(
              'label'     => Mage::helper('sales')->__('Generate'),
              'onclick'   => "setLocation('".$this->getUrl('CUstome URL LINK')."')"

)); 

1 Answer 1

1

The Magento getUrl methods are used for converting a route into a full URL including domain name. If you're attempting to link to another domain you do not need to pass it to setUrl. You can probably do something like:

$this->_addButton('order_reorder', array(
    'label'     => Mage::helper('sales')->__('Generate'),
    'onclick'   => "window.open('http://www.google.com');",
)); 

Though I'm not sure you can reliably force open a new tab cross browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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