1

I am using custom module and want to send order comment data when comment is added to order. Can you please let me know which event will be useful for after add comment. I am using Third party API and want to send data to other website so I need exact event which will work better

2
  • but there is no solution my question is like that
    – Jack
    Jun 21, 2016 at 7:09
  • 1
    It's the same question and the answer is straightforward: Use "sales_order_status_history_save_after". If you need to know more, please rephrase your question. Jun 21, 2016 at 7:45

2 Answers 2

1

You can use sales_order_status_history_save_before or sales_order_status_history_save_after and you will get the comment you are saving as an object using $observer->getEvent()->getStatusHistory()

2
  • I tried $observer->getEvent()->getStatusHistory(), but the output only shows "Object", not the text from the comment I just added. Did I miss anything? Aug 21, 2017 at 9:52
  • see what that object contains.
    – Marius
    Aug 21, 2017 at 10:51
0

You can use the following event: controller_action_postdispatch_adminhtml_sales_order_addComment

In your observer you can then retrieve the comment post by calling:

$comment = $observer->getEvent()->getControllerAction()->getRequest()->getParam('comment');

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