Magento Add Order Status History Comment

Adding an order status history comment to a Magento order object is easy, when you know how!

There is a very helpful Mage_Sales_Model_Order::addStatusHistoryComment() method which will take a comment and optional order status and either just save the comment or save the comment and update the order status.

However I found that it didn’t quite work for me. Reading the docblock on the Mage_Sales_Model_Order::addStatusHistory() method, it turns out that it won’t take effect unless the order object itself is saved.

So in a nutshell this is how to add a comment to an order in Magento


Tags: magentoorderstatushistorycomment