"From" e-mail address value is wrong for 'order processed' notifications

In X-Cart 4.x branch (and probably earlier ones also) notifications about processed orders have the store order department address as a “from” e-mail address value. As a rule, all order and other notifications are delivered with customers' addresses in the “from” field, however the notifications about processed orders come from your own order department address. And that is absolutely wrong.

In order to fix it you should open a file include/func/func.order.php and find the function func_process_order in it. Here is the code you would find, the function content was cut out, and the following piece of the code is the one that needs to be changed:

#
# This function performs activities required for an order processing
#
function func_process_order($orderids) {
...
		$mail_smarty->assign("products",$products);
		$mail_smarty->assign("show_order_details", "Y");
		if ($config['Email_Note']['eml_order_p_notif_admin'] == 'Y') {
			$to_customer = $config['default_admin_language'];
			func_send_mail($config["Company"]["orders_department"], "mail/order_notification_subj.tpl", "mail/order_notification_admin.tpl", $config["Company"]["orders_department"], true, true);
		}

		$mail_smarty->assign("show_order_details", "");
...
}

#
# This function performs activities required for an order completion
#

You should replace the line containing func_send_mail function with the following one:

func_send_mail($config["Company"]["orders_department"], "mail/order_notification_subj.tpl", "mail/order_notification_admin.tpl", $userinfo["email"], true, true);

As a result, your store order department e-mail will be replaced by user address in the “from” field of processed order notifications.