getNode('global/sales/order/statuses')->asArray(); foreach ($statuses as $code => $info) { $data[] = array( 'status' => $code, 'label' => $info['label'] ); } $installer->getConnection()->insertArray( $installer->getTable('sales/order_status'), array('status', 'label'), $data ); /** * Install order states from config */ $data = array(); $states = Mage::getConfig()->getNode('global/sales/order/states')->asArray(); foreach ($states as $code => $info) { if (isset($info['statuses'])) { foreach ($info['statuses'] as $status => $statusInfo) { $data[] = array( 'status' => $status, 'state' => $code, 'is_default' => is_array($statusInfo) && isset($statusInfo['@']['default']) ? 1 : 0 ); } } } $installer->getConnection()->insertArray( $installer->getTable('sales/order_status_state'), array('status', 'state', 'is_default'), $data );