i have learned that modules/pages/checkout_success/header_php.php does find the order id
my code seems slightly different (but i can not really see how there a "different order-id could come up"
Code:
// find out the last order number generated for this customer account
$orders_query = "SELECT * FROM " . TABLE_ORDERS . "
WHERE customers_id = :customersID
ORDER BY date_purchased DESC LIMIT 1";
$orders_query = $db->bindVars($orders_query, ':customersID', $_SESSION['customer_id'], 'integer');
$orders = $db->Execute($orders_query);
$orders_id = $orders->fields['orders_id'];
// use order-id generated by the actual order process
// this uses the SESSION orders_id, or if doesn't exist, grabs most recent order # for this cust (needed for paypal et al).
// Needs reworking in v1.4 for checkout-rewrite
if ((!isset($orders_id))&&($orders_id!="")) {
$zv_orders_id = (isset($_SESSION['order_number_created']) && $_SESSION['order_number_created'] >= 1) ? $_SESSION['order_number_created'] : $orders_id;
$orders_id = $zv_orders_id;
$order_summary = $_SESSION['order_summary'];
unset($_SESSION['order_summary']);
unset($_SESSION['order_number_created']);
}
if ((!isset($zv_orders_id))||($zv_orders_id =="")) {
$zv_orders_id = $orders->fields['orders_id'];
}
the other question .. in what file is the email beeing send (because in the email and the order, the ID is always correct)
Bookmarks