HOLDING ORDERS FOR OSCOMMERCE
Original version 1.1b by Dave
- Support for this program will be offered via email at support@puddled.co.uk
- Donations kindly accepted at dave@puddled.co.uk (paypal / nochex)
Updated version 2.0 for MS2.2 compatibility by Carine Bruyndoncx (info@calimeross.com)
V2.0 Changes
- edit admin/held_orders.php and replace tep_array_merge with just array_merge
- edit admin/includes/classes/confirm_held_order uncomment the ip_address field as this is not part of the standard install, alternatively, you could add the field to the orders table and lookup the remainder of the installation instructions for the ip tracking contribution.
- catalog/includes/application_top.php and admin/includes/application_top.php changes need to be applied to the database_tables.php and filenames.php files (standard MS2 file changes)
- correction of filename define for packingslip in instructions
- correction of english and addition of dutch language file
New! in V1.1 version, facility to restore held orders to main orders tables, including all status / status histories / attributes and the like
This package is designed to allow the storing of orders in a holding table, just in case the order is not completed correctly.
All orders in the holding tables are available to edit via the admin console in the same way, normal orders are
This package is still in beta version, so please ensure you have adequate backups in place before attempting to install.
UPGRADE FROM V1b
1. Open catalog->checkout_payment.php
Look forthe line that reads (approx line 40)
//stock check
Just before this line add the following
if (tep_session_is_registered('held_order')) {
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');
}
save and close the file
2. Open catalog->checkout_process.php
Towards the bottom of the file look for the following line
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));
and add the following just before it
if (tep_session_is_registered('held_order')) {
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');
}
Save and close the file.
Upload all the files contained within the zip to thier respective directories, overwriting any existing files.
CLEAN INSTALLATION.
1, Run the enclosed sql query on the database to create the required additional tables.
2. Add the following defines to catalog/includes/database_tables.php
define('TABLE_HOLDING_ORDERS', 'holding_orders');
define('TABLE_HOLDING_ORDERS_PRODUCTS', 'holding_orders_products');
define('TABLE_HOLDING_ORDERS_TOTAL', 'holding_orders_total');
define('TABLE_HOLDING_ORDERS_STATUS', 'holding_orders_status');
define('TABLE_HOLDING_ORDERS_PRODUCTS_ATTRIBUTES', 'holding_orders_products_attributes');
define('TABLE_HOLDING_ORDERS_PRODUCTS_DOWNLOAD', 'holding_orders_products_download');
define('TABLE_HOLDING_ORDERS_STATUS_HISTORY', 'holding_orders_status_history');
3.a. Add the following defines to admin/includes/database_tables.php
define('TABLE_HOLDING_ORDERS', 'holding_orders');
define('TABLE_HOLDING_ORDERS_PRODUCTS', 'holding_orders_products');
define('TABLE_HOLDING_ORDERS_TOTAL', 'holding_orders_total');
define('TABLE_HOLDING_ORDERS_STATUS', 'holding_orders_status');
define('TABLE_HOLDING_ORDERS_PRODUCTS_ATTRIBUTES', 'holding_orders_products_attributes');
define('TABLE_HOLDING_ORDERS_PRODUCTS_DOWNLOAD', 'holding_orders_products_download');
define('TABLE_HOLDING_ORDERS_STATUS_HISTORY', 'holding_orders_status_history');
3.b. Add the following defines to admin/includes/filenames.php
DEFINE('FILENAME_HELD_ORDERS', 'held_orders.php');4. Open catalog/checkout_confirmation.php for editing
Look for
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_CONFIRMATION);
On the line before it add the following
require('held_orders_process.php');
Scroll down the page, and look for
<?php
if (MODULE_ORDER_TOTAL_INSTALLED) {
$order_total_modules->process();
echo $order_total_modules->output();
}
?>
And change it to read
<?php
if (MODULE_ORDER_TOTAL_INSTALLED) {
// $order_total_modules->process();
echo $order_total_modules->output();
}
?>
5. Open admin/includes/boxes/customers.php
and add the following before the last '<a href statement
'<a href="' . tep_href_link(FILENAME_HELD_ORDERS, '', 'NONSSL') . '" class="menuBoxContentLink">Held Orders</a><br>' .
7. Open catalog->checkout_payment.php
Look for the line that reads (approx line 40)
//stock check
Just before this line add the following
if (tep_session_is_registered('held_order')) {
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');
}
save and close the file
8. Open catalog->checkout_process.php
Towards the bottom of the file look for the following line
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));
and add the following just before it
if (tep_session_is_registered('held_order')) {
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');
}
Save and close the file.
9. Upload all the files enclosed in the zip file to their respective directories.
Now whenever an order is placed, it will be logged to the table holding_orders, so should you recieve a payment form a customer, but no order, log into your admin console, and select Held orders from the customer box, and a list of all orders will appear, just select the order requried.
All actions performed via this file, will reflect only in the held orders table, and not the main orders table, however all functions are correct, as per the main orders page.
If you get any problems, make any changes, have any suggestion, please email me at support@puddled.co.uk
If you find this useful, and wish to make a donation, please do so using paypal, dave@puddled.co.uk
Thanks, and have fun