tnw_salesforce_order_sync_after_final
An event is triggered after the end of the synchronization process.
TNW_Salesforce_Block_Sales_Order_Status_New_Form
Mage::dispatchEvent('tnw_salesforce_order_sync_after_final', array('all' => $_all, 'failed' => $_failed));
How to use this event:
Several steps are involved into utilizing this event:
config.xml
a listener should be added for this event
a listener should point to a Magento Observer module and a method in that observer
Magento Observer
holds a method where you can add your custom logic
Example Config
<?xml version="1.0"?>
<config>
<global>
<events>
<tnw_salesforce_order_sync_after_final>
<observers>
<salesforce_order_sync_after_final_observer>
<class>tnw_salesforce/observer</class>
<method>orderSyncAfterFinal</method>
</salesforce_order_sync_after_final_observer>
</observers>
</tnw_salesforce_order_sync_after_final>
</events>
</global>
</config>Example Observer
<?php
/**
* Class TNW_Salesforce_Model_Observer
*/
class TNW_Salesforce_Model_Observer
{
public function orderSyncAfterFinal(Varien_Event_Observer $observer) {
/**
* Array of Order Numbers
* @var array $_all
*
* Example:
* array (size=1)
* 183 => string '100000202' (length=9) // 183 - Magento order ID
*/
$_all = $observer->getData('all');
/**
* Array of Order Ids
* @var array $_failed
*
* Example:
* array (size=0)
* empty
*/
$_failed = $observer->getData('failed');
// Your custom code
}
}