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"); 

1 Answer 1

1

You can use following -

Mage::helper('adminhtml')->getUrl("modulename/adminhtml_controller/action");
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for your response, i dont know what is wrong with this link. Do i need to add the controller to config.xml? localhost/magento/index.php/Module_Parcel/adminhtml_controller/…
Try following url as per your controller codeMage::helper('adminhtml')->getUrl("parcel/integer/multiply");

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.