Skip to content

Instantly share code, notes, and snippets.

@herveguetin
Last active March 1, 2017 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herveguetin/53e2d9660142052ef432 to your computer and use it in GitHub Desktop.
Save herveguetin/53e2d9660142052ef432 to your computer and use it in GitHub Desktop.
This is how to create an new order status in Magento
<?php
// Create new order status
$data = array(
'status' => 'status_code',
'label' => 'Default Label'
);
$status = Mage::getModel('sales/order_status');
$status->setData($data)->save();
// Assign to some order state
$status->assignState(Mage_Sales_Model_Order::CONST_KEY_FOR_STATE);
?>
@antoinekociuba
Copy link

Used today again.. Thx!

@atokarczyk
Copy link

used here as well! Thx :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment