Skip to content

Instantly share code, notes, and snippets.

@dleone81
Last active January 5, 2016 15:05
Show Gist options
  • Save dleone81/b3430cfde61751540fd1 to your computer and use it in GitHub Desktop.
Save dleone81/b3430cfde61751540fd1 to your computer and use it in GitHub Desktop.
Set status COMPLETE for order array via PHP script
<?php
require_once 'app/Mage.php';
umask(0);
Mage::app();
$orders = array('200000674','200000676','200000678');
foreach ($orders as $k => $v) {
$order_id = $v;
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
$order->setData('state', "complete");
$order->setStatus("complete");
$history = $order->addStatusHistoryComment('Order status changed via script.', false);
$history->setIsCustomerNotified(false);
$order->save();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment