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_beforeafter', array('oid' => $_oid, 'note' => $_note, 'type' => 'Order')); |
...
Code Block |
---|
language | xml |
---|
title | Example Config |
---|
|
<?xml version="1.0"?>
<config>
<global>
<events>
<tnw_salesforce_order_comments_save_before>after>
<observers>
<tnw_salesforce_order_comments_save_before>after>
<class>tnw_salesforce/observer</class>
<method>orderCommentsSaveBefore<<method>orderCommentsSaveAfter</method>
</tnw_salesforce_order_comments_save_before>after>
</observers>
</tnw_salesforce_order_comments_save_before>after>
</events>
</global>
</config> |
Code Block |
---|
language | php |
---|
title | Example Observer |
---|
|
<?php
/**
* Class TNW_Salesforce_Model_Observer
*/
class TNW_Salesforce_Model_Observer
{
public function orderCommentsSaveBeforeorderCommentsSaveAfter(Varien_Event_Observer $observer) {
/**
* Magento Order id
* @var int $_oid
*
* Example:
* int(143)
*/
$_oid = $observer->getData('oid');
/**
* Magento Note oject
* @var mixedMage_Sales_Model_Order_Status_History $_note
*/
$_note = $observer->getData('note');
/**
* Order
* @var string $_type
*
* Example:
* string 'Order'
*/
$_type = $observer->getData('type');
// Your custom code
}
} |
Related articles
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | POW |
---|
showSpace | false |
---|
sort | modified |
---|
reverse | true |
---|
type | page |
---|
cql | label in ("magento","events") and type = "page" and space = "POW" |
---|
labels | events magento |
---|
|
...