Tutorial by Examples

$orderid = 12345; $order = Mage::getModel('sales/order')->load($orderid); The above code is roughly analogous to the following SQL query. select * from sales_flat_order where entity_id=12345;
$incrementid = 100000000; $order = Mage::getModel('sales/order')->loadByIncrementId($incrementid); The above code is roughly analogous to the following SQL query. select * from sales_flat_order where increment_id=100000000; The increment_id is the customer facing order identifier, whereas...
You can add comment and status to order. Get order : $orderid = 12345; $order = Mage::getModel('sales/order')->load($orderid); And add comment: //$isNotify means you want to notify customer or not. $order->addStatusToHistory($status, $message, $isNotify); $order->save()

Page 1 of 1