Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Magento: Set order states by orderIncrementId programmatically
<?php
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
$orderIncrementIds[] = XXX;
$orderIncrementIds[] = XXX;
foreach ($orderIncrementIds as $orderIncrementId){
$order = Mage::getModel('sales/order')->load($orderIncrementId);
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true)->save(); // e.g. set state to Processing
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment