1

I'm using an observer to watch <sales_order_status_history_save_after>, but it returns ALL comments, how can I get just the last one?

2

Try below code to get latest comment.

<?php
$order = Mage::getModel('sales/order')->load($orderId);
$history = $order->getStatusHistoryCollection()->getFirstItem();
echo $history->getComment();
?>

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.