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 save the comment to the order.

Code Block
languagephp
titleTNW_Salesforce_Block_Sales_Order_Status_New_Form
Mage::dispatchEvent('tnw_salesforce_order_comments_save_after', array('oid' => $_oid, 'note' => $_note, 'type' => 'Order'));

...

Code Block
languagephp
titleExample Observer
<?php

/**
 * Class TNW_Salesforce_Model_Observer
 */
class TNW_Salesforce_Model_Observer
{

    public function orderCommentsSaveAfter(Varien_Event_Observer $observer) {
		/**
		 * Magento Order id
		 * @var int $_oid 
         * 
         * Example:
         *   int(143)
		 */
		$_oid = $observer->getData('oid');

		/** 
		 * Magento Note oject
		 * @var Mage_Sales_Model_Order_Status_History $_note
		 */
		$_note = $observer->getData('note');

		/** 
		 * Order
		 * @var string $_type 
         * 
         * Example:
         *   string 'Order'
		 */
		$_type = $observer->getData('type');

		// Your custom code
    }
 
}

...