I want to call an observer on reorder to get the order id.suggest me some 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');

其他提示

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>
许可以下: CC-BY-SA归因
scroll top