I want to send SMS to customers when ever an order status changes from pending > processing > complete (for all sort of changes).
For pending process(when place order is clicked), i should able to get a SMS. Below is the code: Onserver.php
public function sendSMS ($observer)
{
$orderIds = $observer->getEvent()->getOrderIds();
foreach($orderIds as $orderId)
{
$order = Mage::getModel('sales/order')->load($orderId);
$orderId = $order->getId();
$order_status = $order->getStatus();
$smsMessageTemp =Mage::getModel('core/variable')->loadByCode('template_sms_order_placement_confirmation')->getValue('plain');
. . . . .
}
}
When admin changes the state from pending to processing , how to send sms for different events.
In my .xml file:
<events>
<sales_order_save_after>
<observers>
<Metro_SellerPurchaseOrder>
<type>singleton</type>
<class>sellerpurchaseorder/observer</class>
<method>sendSMS</method>
</Metro_SellerPurchaseOrder>
</observers>
</sales_order_save_after>
</events>
Please suggest.