1

I made a new button in adminhtml by extending *Mage_Adminhtml_Block_Sales_Order* and now i want to have some functionality in it.

    class Module_Parcel_Block_Adminhtml_Sales_Order extends Mage_Adminhtml_Block_Sales_Order 
    {
        public function  __construct() {

            $this->_addButton('Parcel Sync', array(
                'label'     => Mage::helper('Sales')->__('Parcel Sync'),
                'onclick'   => 'window.open(\'/magento/app/code/local/Module/Parcel/Controller/Sync.php\')',
                'class'     => 'go'
            ), 0, 100, 'header', 'header');

            parent::__construct();
        }
    }

You can see here how i implement my button, the onclick function is wrong because i can not acces my controller like that. How do i solve this?

EDIT this is my controller

class Module_Parcel_IntegerController extends Mage_Core_Controller_Front_Action
{
    public function multiplyAction()
    {
        echo 'Works';
    }
}

Do i need to add this controller to config.xml to get this code working? (thx to magik)

Mage::helper('adminhtml')->getUrl("Module_Parcel/adminhtml_controller/sync"); 
tereško
  • 58,060
  • 25
  • 98
  • 150
SinisterGlitch
  • 195
  • 3
  • 25

1 Answers1

1

You can use following -

Mage::helper('adminhtml')->getUrl("modulename/adminhtml_controller/action");
Tejas Shah
  • 563
  • 1
  • 4
  • 12
  • Thank you for your response, i dont know what is wrong with this link. Do i need to add the controller to config.xml? http://localhost/magento/index.php/Module_Parcel/adminhtml_controller/sync/key/f19eb0677cbe028d33306de9ae3dd9d0/ – SinisterGlitch Jan 21 '14 at 10:32
  • Try following url as per your controller codeMage::helper('adminhtml')->getUrl("parcel/integer/multiply"); – Tejas Shah Jan 22 '14 at 05:12