PHP Classes

File: alter-status-add-comment.php

Recommend this page to a friend!
  Classes of Victor Andeloci   Useful Magento Scripts   alter-status-add-comment.php   Download  
File: alter-status-add-comment.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Useful Magento Scripts
Run product operations in Magento e-commerce sites
Author: By
Last change:
Date: 9 days ago
Size: 377 bytes
 

Contents

Class file image Download
<?php

include_once './app/Mage.php';
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$ordersIds = array(
   
'1',
   
'2',
);

foreach (
$ordersIds as $orderId) {
   
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);

   
// status slug and comment
   
$order->addStatusToHistory('complete_shipped', 'Status comment');
   
$order->save();
}