* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ class Magemaven_OrderComment_Model_Observer extends Varien_Object { /** * Save comment from agreement form to order * * @param $observer */ public function saveOrderComment($observer) { $orderComment = Mage::app()->getRequest()->getPost('ordercomment'); if (is_array($orderComment) && isset($orderComment['comment'])) { $comment = trim($orderComment['comment']); if (!empty($comment)) { $order = $observer->getEvent()->getOrder(); $order->setCustomerComment($comment); $order->setCustomerNoteNotify(true); $order->setCustomerNote($comment); } } } }