Save order data in a plain text file Just like the order data can be sent via email, I want to save the order data in a plain text file in a specific directory on the same server as the drupal installation.

Is it possible? How can I achieve this?
Saving a file should be a fairly simple job with PHP. If you want to do it when an order is completed, you could make a conditional action for it, or use one of the hooks that's invoked when the order is completed.

If you have an concrete problems on how to do this, you should refine your question.

If you want to save the mail sent, this would hold the order info, you could create a custom module and use hook_mail_alter to get the mail text:

/**
 * Implements hook_mail_alter().
 */
function my_module_mail_alter(&amp;$message) {
  if ($message['id'] == 'uc_order_action-mail') {
    $message_text = $message['body'];
    // Code to save text as txt file here.
  }
}


By default the mail sent with ubercart is a HTML mail, so you might want to create your own text instead.

Whatever you do, you shouldn't alter Drupal or any of the modules, you should create your own module(s) that make the alteration. If you are new to Drupal development, you should read the developer guide.