Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

An event is triggered to allow PowerSync product to customize 'Sales Order Status' form in Magentoafter the end of the synchronization process.

Code Block
languagephp
titleTNW_Salesforce_Block_Sales_Order_Status_New_Form
Mage::dispatchEvent('tnw_salesforce_order_sync_after_final', array('all' => $_all, 'failed' => $_failed));

...

Code Block
languagexml
titleExample Config
<?xml version="1.0"?>
<config>
    <global>
        <events>
            <tnw_salesforce_order_sync_after_final>
                <observers>
                    <tnw_salesforce<salesforce_order_sync_after_final>final_observer>
                        <class>tnw_salesforce/observer</class>
                        <method>orderSyncAfterFinal</method>
                    </tnw_salesforce_order_sync_after_final_final>observer>
                </observers>
            </tnw_salesforce_order_sync_after_final>
        </events>
    </global>
</config>
Code Block
languagephp
titleExample 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
    }
 
}

...