How to get Comments History of the order Pending->Processing->Awaiting Shipment->Shipped->Complete
My code :
<?php
require_once('app/Mage.php');
umask(0);
Mage::app();
// try{
$orders = Mage::getModel('sales/order')->load('10');
foreach ($orders as $order) {
$orderComments = $order->getAllStatusHistory();
print_r($orderComments);
}
// }catch(Exception $e){
// echo $e->getMessage();
// }How to get Comments History of the order Pending->Processing->Awaiting Shipment->Shipped->Complete
Solved! Go to Solution.
The screenshot is not accessible.
You may get order details in the sales\order\info.phtml file by using following code.
<?php $_order = $this->getOrder() ?>
After getting $_order you can the order increment id or real order id.
Hi @Aveeva
You may try following code
<?php
require_once('app/Mage.php');
umask(0);
Mage::app();
$orders = Mage::getModel('sales/order')->load('10');
$statusHistory = $order->getStatusHistoryCollection()->getData();
$details = array();
foreach($statusHistory as $status)
{
$details [] = $status['entity_name'].','.$status['status'].','.$status['comment'];
}
echo "<pre>";
print_r($details);
@Mukesh Tiwari If i use this script to my customer order account, how to load current order id,
screenshot : https://snipboard.io/EAGve0.jpg
The screenshot is not accessible.
You may get order details in the sales\order\info.phtml file by using following code.
<?php $_order = $this->getOrder() ?>
After getting $_order you can the order increment id or real order id.