An event is triggered to allow PowerSync product to customize 'Sales Order Status' form in Magentoafter save the comment to the order.
Code Block |
---|
language | php |
---|
title | TNW_Salesforce_Block_Sales_Order_Status_New_Form |
---|
|
Mage::dispatchEvent('tnw_salesforce_order_comments_save_after', array('oid' => $_oid, 'note' => $_note, 'type' => 'Order')); |
...
Code Block |
---|
language | php |
---|
title | Example 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
}
} |
...