Question

I want to call an observer on reorder to get the order id.suggest me some solution.

Was it helpful?

Solution

You can hook into the controller_action_predispatch_sales_order_reorder event and then get the order id parameter on the observer

$oldOrderId=Mage::app()->getRequest()->getParam('order_id');

OTHER TIPS

I am not sure if you want to reorder it from adminpanel or frontend. From the adminpanel you can use this event:

controller_action_predispatch_adminhtml_sales_order_create_reorder

<adminhtml>
    <events>
        <controller_action_predispatch_adminhtml_sales_order_create_reorder>
            <observers>
                <mynamespace_mymodule_controller_action_predispatch_adminhtml_sales_order_create_reorder>
                        <class>Mynamespace_Mymodule_Model_path_to_your_class</class>
                        <method>yourMethodName</method>
                </mynamespace_mymodule_controller_action_predispatch_adminhtml_sales_order_create_reorder>
             </observers>
        </controller_action_predispatch_adminhtml_sales_order_create_reorder>
    </events>
</adminhtml>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top