Skip to content

Instantly share code, notes, and snippets.

@aliomattux
Created October 24, 2013 21:47
Show Gist options
  • Save aliomattux/7145622 to your computer and use it in GitHub Desktop.
Save aliomattux/7145622 to your computer and use it in GitHub Desktop.
public function setFlagForOrder($incrementIds) {
/**
* Get Core Resource
*/
$resource = Mage::getSingleton('core/resource');
/**
* Get Write Connection
*/
$writeConnection = $resource->getConnection('core_write');
$incrementIds = implode( ',', (array) $incrementIds );
/**
* Prepare Query
*/
$query = "UPDATE sales_flat_order SET imported=1 WHERE increment_id IN ({$incrementIds}$
/**
* Execute the query
*/
try {
$writeConnection->query($query);
return true;
} catch (Mage_Core_Exception $e) {
$this->_fault('data_invalid', $e->getMessage());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment