Skip to content

Instantly share code, notes, and snippets.

@thestuntcoder
Created May 30, 2016 17:34
Show Gist options
  • Save thestuntcoder/f46ab7bb55d0db892af863fc16b5b405 to your computer and use it in GitHub Desktop.
Save thestuntcoder/f46ab7bb55d0db892af863fc16b5b405 to your computer and use it in GitHub Desktop.
// get the last order
$lastOrderId = $this->_getOnepage()->getCheckout()->getLastOrderId();
$order = Mage::getModel('sales/order')->load($lastOrderId);
// Add the comment and save the order (last parameter will determine if comment will be sent to customer)
$order->addStatusHistoryComment('This comment is programatically added to last order in this Magento setup');
$order->save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment