Held Orders v1b
for osCommerce Online Merchant v2.2
A mod to allow the logging of all orders before the checkout proceeds to third party payment processors.
There is a full admin module to allow the tracking and updating of these orders as per normal.
Legend: 
Download

Report
Added block of code for transferring data from HOLDING_ORDERS_PRODUCTS_DOWNLOAD table to ORDERS_PRODUCTS_DOWNLOAD
updated a few blocks of code that are supposed to empty the holding tables but left out the DOWNLOAD table
Roll up of last three uploads.
Credit to those below.
If a user abandons the order, it is still left in the held orders table. This includes a user logging off.
To prevent the table from growing due to orders which were abandoned, I added a bit of code. What it does is check if we are in a checkout page.
If we are, then we either need the held order or it will be removed.
If we are not, and there is a hold, then the user has abandoned the order for now, either by going to a non-checkout page or by logging off.
- Open catalog/includes/header.php
- At the top, paste the following:
/* Contribution - update to the Held_orders package: */
/*
- Adding code so that if an order is held and user leaves checkout area, then it is removed.
- This prevents held orders from accumulating, even if user logs off.
*/
if (tep_session_is_registered('held_order'))
{
// Check if the user is in the checkout area
$oscTestForCheckout_url = strtoupper($_SERVER['PHP_SELF']);
$findString = "CHECKOUT";
$pos = strpos($oscTestForCheckout_url, $findString);
if ($pos > 0)
{
// This is one of osCommerce's CheckOut pages. Leave the held order intact.
}
else
{
// If not, then delete this held order. It has been abandoned by the user.
tep_db_query("delete from " . TABLE_HOLDING_ORDERS . " where orders_id = '" . $held_order . "'");
tep_db_query("delete from " . TABLE_HOLDING_ORDERS_PRODUCTS . " where orders_id = '" . $held_order . "'");
tep_db_query("delete from " . TABLE_HOLDING_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . $held_order . "'");
tep_db_query("delete from " . TABLE_HOLDING_ORDERS_STATUS_HISTORY . " where orders_id = '" . $held_order . "'");
tep_db_query("delete from " . TABLE_HOLDING_ORDERS_TOTAL . " where orders_id = '" . $held_order . "'");
tep_session_unregister('held_order');
}
}
Needs "Held Orders v2.0 MS2 ready" to be installed first.
Zip file is included, but not needed if you just apply the fix, as described below.
**********************
Problem:
When an order was moved from the "held_orders" to the "orders" table the date, comments and status were not copied.
The cause is a typo in confirm_held_order.php
Solution:
In admin/includes/classes/confirm_held_order.php
change (2x):
$stauts
to:
$status
(or overwrite the old confirm_held_order.php file with the the include confirm_held_order.php file)
Updated installation pack for MS2 compatibility and corrected little bug in installation instructions.
Full details are in the install pack.
All credits to the original author.
Now includes updated admin system with correct delete process.
Updated customer routines with held orders registerring in the customers session, removal of held orders on success completion of checkout, and also should a customer change their mind part way through the checkout process.
Fixes an erro onthe delete order system, which could have resulted inthe loss of genuine orders form the main tables.
Just uplaod to the main admin directory, replacing the original file
Updatedadmin system, that now allows you to move a held order to the main orders tables, including all associated order information, attributs, stautses etc.
If upgrading from v1b, just overwrite existing files, no further changes required.
If a clean install, follow the install file
A mod to allow the logging of all orders before the checkout proceeds to third party payment processors.
There is a full admin module to allow the tracking and updating of these orders as per normal.