سؤال

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 مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top