function query($order_id) {
global $languages_id;
$order_id = tep_db_prepare_input($order_id);
$order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_telephone, delivery_fax, delivery_email_address, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_telephone, billing_fax, billing_email_address, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_ccv, cc_expires, currency, currency_value, date_purchased, orders_status, ipaddy, ipisp, last_modified, payment_id,cc_start,cc_issue from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
$order = tep_db_fetch_array($order_query);
$totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
$order_total_query = tep_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_total'");
$order_total = tep_db_fetch_array($order_total_query);
$shipping_method_query = tep_db_query("select title,value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_shipping'");
$shipping_method = tep_db_fetch_array($shipping_method_query);
The issue could very well be the fact that I am adapting this to creloaded. Although I found most of the find/additions to be where the readme suggested to look.