Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Created June 1, 2015 17:44
Show Gist options
  • Select an option

  • Save ryaan-anthony/bddd8f90284c66b6a7a3 to your computer and use it in GitHub Desktop.

Select an option

Save ryaan-anthony/bddd8f90284c66b6a7a3 to your computer and use it in GitHub Desktop.
Set magento orders to complete.
<?php
require_once 'app/Mage.php';
$app = Mage::app();
Mage::register('isSecureArea', true);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$order = Mage::getModel('sales/order')->loadByIncrementId('100000266');
$order->setData('state', 'complete');
$order->setStatus('complete');
$history = $order->addStatusHistoryComment('Order was set to Complete by our automation tool.', false);
$history->setIsCustomerNotified(false);
$order->save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment