php - Magento order status change events -


I want to change a remote list through the web service, I know that through the Event Observer method, my code Triger, but I do not know which event is useful for completing my work, such as ______ complete, there is an updated list of events or more documents?

If you want to transmit an event, when an order changes in any situation or situation , You have to include your own event listener. It is not as difficult as it sounds.

If you override the _setStatus function Mage_Sales_Model_Order is the same ...

  / ** * Order Model * * @ Category WMG * @ Packet WMG_Sales * @Author Lee Bolding & lt; Lee.bolding@wmg.com> * Supported events: * Sales_order_status_before * Sales_order_status_after * Note: Unfortunately, we * functions can not override is done by * function registerCancellation (as _setState protected setState () ()) and _checkState () * / Square WMG_Sales_Model_Order extends Mage_Sales_Model_Order {/ ** * Order State Protected Setter * Allows to set any state by default. Also the default or position fixed value can be updated * Сomplete and closed states are deliberately updated, see _checkState () * * @param string $ state * @param string | bool $ conditions * @param string $ comment * @param bool $ isCustomerNotified * @param $ shouldProtectState * @return Mage_Sales_Model_Order * / protected function _setState ($ state, $ status = false, $ comment = '', $ isCustomerNotified = null, $ shouldProtectState = false) before we try {// an event dispatch anything mage :: dispatchEvent ( 'sales_order_status_before', array ( 'order' = & gt; $ this, 'state' = & gt; $ state; 'Status' = & gt; $ position, 'comment' = & gt; $ comment, 'isCustomerNotified' = $ is customer-appointed, 'project-state' = & gt; $ protected;); // attempts to establish state specified ($ ShouldProtectState) {if ($ this- & gt; isStateProtected ($ state)) {Dana :: ThrowException (Mage :: helper ( 'sale') - & gt ; __ ('order state "% s" should not be set manually.', $ State)); }} $ This-> Setdata ('state', $ state); // Add status status history ($ position) {if ($ position === true) {$ status = $ this- & gt; GetConfig () - & gt; GetStateDefaultStatus ($ state); } $ This- & gt; Setstats ($ position); $ History = $ this- & gt; AddStatusHistory comment ($ comment, incorrect); $$ does not make sense to restore status $ history-> Set Ice Customer Notification ($ isCustomerNotified); // for the rear compatibility) // has changed the situation after an Mage Post: Migration DispatchEvent ('sales_order_status_after', array ('order' = & gt; $ this, 'state' = & gt; $ state, 'Status' = & gt; $ position, 'comment' = $ gt; $ comment, 'customer-appointed' => $ is assigned to client, 'projectstate' => $ protected protected location) ; $ This return;  

Now the newly created sales_order_status_before and sales_order_status_after event


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -