0

I wanna show the username who commented on order history

my question is like below question

https://stackoverflow.com/questions/6219620/add-username-to-order-comment-history

but it is for Magento 1.4 and it doesn't work for me. magento version 1.9.3.7

1

You can create a module and override file ( app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php ):

There you will find function addCommentAction:

https://github.com/MrRio/magento/blob/master/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php#L191

and / change line of code from :

$order->addStatusToHistory($data['status'], $data['comment'], $notify);

To :

$current_Admin = Mage::getSingleton('admin/session')->getUser();
    if(isset($current_Admin)) {
        $commentwithUser = '[ BY: '.$current_Admin->getUsername().' ] - '.$data['comment'];
    }
$order->addStatusToHistory($data['status'], $commentwithUser, $notify);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.