Excellent info, PHPDev!

Here's my variation but it was inspired by your excellent and detailed information.
The store owner wanted customers to indicate during checkout if this was their first order. I was pushing this into the Customer Notes field with Javascript, but this isn't convenient since those notes are encrypted as part of the payment info. I just wanted the info to be stored with the order, so I used order_extras.
This is with x-cart 4. "First_Time" is the name of the form field the user is selecting from on the checkout form. Also, I'm using Javascript to validate to ensure the user is selecting something in this new menu.
In include/func.php, add the new field (order_first) to function func_place_order:
Code:
function func_place_order($payment_method, $order_status, $order_details, $order_first, $extra = array(), $extras = array()) {
Also in include/func.php in the same function func_place_order, add the following:
Code:
$extras['First_Time'] = $order_first;
...just before:
Code:
if(!empty($extras)) {
In payment/payment_cc.php, add the new field just below
$order_details = "";, around line 78, to capture the user's input:
Code:
$order_details = "";
$order_first = $First_Time;
In the same file, add the new field to
$orderids = func_place_order around line 109 and again around line 140 so they look like the following, respectively:
Code:
$orderids = func_place_order("$payment_method (".$module_params["module_name"].(get_cc_in_testmode($module_params)?", in test mode":"").")", "I", $order_details, $order_first);
Code:
$orderids = func_place_order($payment_method." (manual processing)","Q",$order_details,$order_first);
Now the field is stored with the order in the order_extras table. You should be able to pull this data as part of the order wherever you need it, such as on the invoice, for example:
Code:
<TR>
<TD>First order?</TD>
<TD>{$order.extra.First_Time}</TD>
</TR>