Magento Order – Modify Order on Submit

edit-orderevent-observermagento-community

I need to create a module which can allow a user to change the string used on the front end for delivery methods and use existing delivery methods from another module. I've got a decent idea of how to the conversion and everything, but I don't know what observer event I should be using to catch the order once it's been submitted. Does anyone know which one will let me catch the order before it's placed?

Best Answer

The event that is dispatch right before Magento saved the order is: sales_model_service_quote_submit_before

Mage::dispatchEvent('sales_model_service_quote_submit_before', array('order'=>$order, 'quote'=>$quote));

You can also use: sales_order_place_before and sales_order_place_after where you know if the order pass payment method.

Mage::dispatchEvent('sales_order_place_before', array('order'=>$this));

Using this events, you can set info in the order but you should not execute $order->save() because this is executed by Magento system in a transactions.

Related Topic