Studyon Minte9.com
Magento




Order Comment



Customer Order Comment

System > Configuration > Sales > Checkout > Checkout Options > Enable Terms and Conditions

-- app/design/frontend/default/default/template/checkout/onepage/agreements.phtml

	<textarea name="myCustomerOrderComment" id="myCustomerOrderComment" style="width:450px;height:100px;"></textarea> 

-- app/code/local/MyCompany/MyOrder/etc/config.xml

	<?xml version="1.0"?>
	<config>
	  <global>
	    <modules>
	      <MyCompany_MyOrder>
		<version>0.1.0</version>
	      </MyCompany_MyOrder>
	    </modules>

	    <helpers>
	      <myorder>
		<class>MyCompany_MyOrder_Helper</class>
	      </myorder>
	    </helpers>    
	  </global>
	  
	  <frontend>
	    <events>
	      <checkout_type_onepage_save_order>
		<observers>
		  <myorder_set_customerordercomment>
		    <type>model</type>
		    <class>MyCompany_MyOrder_Helper_CustomerOrderComment</class>
		    <method>setCustomerOrderComment</method>
		  </myorder_set_customerordercomment>
		</observers>
	      </checkout_type_onepage_save_order>
	    </events>
	  </frontend>  
	</config> 


-- app/code/local/MyCompany/MyOrder/Helper/CustomerOrderComment.php

	<?php
	class MyCompany_MyOrder_Helper_CustomerOrderComment extends Mage_Core_Helper_Abstract
	{
	    public function setCustomerOrderComment($observer)
	    {
		$orderComment = $this->_getRequest()->getPost('myCustomerOrderComment', false);
		$observer->getEvent()->getOrder()->addStatusToHistory('Order Status', $orderComment, false); 
	    }
	} 

See the new Customer comment on Admin/Sales/Orders/Comments History


http://www.magentocommerce.com/boards/viewthread/10268