Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you want to make it easier you could append the username of who write the comment to before or after the comment, instead of creating new fields in the database and less code. (eg. "This is my comment - added by xxxx yyyyy)</p> <p>By creating a custom module that extend admin order controller. (see 'Overriding Frontend Core Controllers' <a href="http://prattski.com/2010/06/24/magento-overriding-core-files-blocks-models-resources-controllers/" rel="nofollow">http://prattski.com/2010/06/24/magento-overriding-core-files-blocks-models-resources-controllers/</a>)</p> <p>Create /app/code/local/RWS/OrderComment/etc/config.xml</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;RWS_OrderComment&gt; &lt;version&gt;0.1.0&lt;/version&gt; &lt;/RWS_OrderComment&gt; &lt;/modules&gt; &lt;admin&gt; &lt;routers&gt; &lt;adminhtml&gt; &lt;args&gt; &lt;modules&gt; &lt;RWS_OrderComment before="Mage_Adminhtml"&gt;RWS_OrderComment_Adminhtml&lt;/RWS_OrderComment&gt; &lt;/modules&gt; &lt;/args&gt; &lt;/adminhtml&gt; &lt;/routers&gt; &lt;/admin&gt; &lt;/config&gt; </code></pre> <p>Create /app/code/local/RWS/OrderComment/controllers/Adminhtml/Sales/OrderController.php</p> <p>(copy addCommentAction method from /app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php)</p> <pre><code>&lt;?php include_once Mage::getModuleDir('controllers', 'Mage_Adminhtml') . DS . 'Sales' . DS . 'OrderController.php'; class RWS_OrderComment_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sales_OrderController { public function addCommentAction(){ ...... // get the login info of current user $_user = Mage::getSingleton('admin/session'); $user['email'] = $_user-&gt;getUser()-&gt;getEmail(); $user['firstname'] = $_user-&gt;getUser()-&gt;getFirstname(); $user['lastname'] = $_user-&gt;getUser()-&gt;getLastname(); $order-&gt;addStatusHistoryComment($data['comment'] . " Added by {$user['firstname']}", $data['status']) -&gt;setIsVisibleOnFront($visible) -&gt;setIsCustomerNotified($notify); } } </code></pre> <p>Create app/etc/modules/RWS_OrderComment.xml</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;config&gt; &lt;modules&gt; &lt;RWS_OrderComment&gt; &lt;active&gt;true&lt;/active&gt; &lt;codePool&gt;local&lt;/codePool&gt; &lt;/RWS_OrderComment&gt; &lt;/modules&gt; &lt;/config&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload