Contributions
Improved Order Number
******************************************************
*
* This contribution adds an order number that
* is more natural to myself. The order number
* will be printed on the invoices as well as
* show in the order list on the admin page.
*
* EXAMPLE ORDER NUMBER: 040919-474718-0009
*
* Contribution by
* Greg Peatfield
*
******************************************************
Expand All / Collapse All
This is a combination of Improved Order Number contrib and all the email fixes in one to make it easier to install.
This contribution is only for Improved Order Number and emails fix. Breadcrum and success message fix are not included.
Step 2 of instructions below for breadcrumb and success message reflects changes for a multishop/multi-store configuration. I caught it too late, sorry everyone. Added minor changes for those with vanilla install of osCommerce:
The attached file reflects the changes below:
FOR THOSE WITH VANILLA INSTALL OF OSCOMMERCE:
Replace:
<h3><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h3></td>
With:
<h3><?php echo TEXT_THANKS_FOR_SHOPPING . '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id='.
$order_id, 'NONSSL') . '">' . tep_trans_id($order->info['date_purchased'], $order_id) . '</a>'; ?></h3></td>
Place the lines below before the ?> and the above lines around line 95:
include(DIR_WS_CLASSES . 'order.php');
$order = new order($order_id);
File contains this same info, this is just in addition to the previous posts:
1. On catalog/account_history_info.php, if you want the breadcrumb to reflect the improved order number:
Replace:
$breadcrumb->add(sprintf(NAVBAR_TITLE_3, $HTTP_GET_VARS['order_id']), tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $HTTP_GET_VARS['order_id'], 'SSL'));
With:
$breadcrumb->add(sprintf(NAVBAR_TITLE_3, tep_trans_id($order->info['date_purchased'], $HTTP_GET_VARS['order_id'])), tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $HTTP_GET_VARS['order_id'], 'SSL'));
Cut these two lines below and paste before the above lines:
require(DIR_WS_CLASSES . 'order.php');
$order = new order($HTTP_GET_VARS['order_id']);
2. On catalog/checkout_success.php, if you want the improved order number to be reflected by the "Thank you" message:
Replace:
<h3><?php echo TEXT_THANKS_FOR_SHOPPING . '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id='. $order_id, 'NONSSL') . '">' . $order_id . '</a>'; //rmh M-S_fixes ?></h3></td>
With:
<h3><?php echo TEXT_THANKS_FOR_SHOPPING . '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id='. $order_id, 'NONSSL') . '">' . tep_trans_id($order->info['date_purchased'], $order_id) . '</a>'; //rmh M-S_fixes ?></h3></td>
Place the lines below before the ?> and the above lines around line 105, :
include(DIR_WS_CLASSES . 'order.php');
$order = new order($order_id);
Note that the actual URL's above will still reflect the old order number, but the customer will "see" the improved order number.
Fix for Object id #?Products instead of order number or no order number.
Changes:
In checkout_process.php add
$order = new order($insert_id);
Above: $email_order = STORE_NAME . "n"
about line number: 223.
not before the replaced line.
a few lines were left out in the below additions maing the order number unavailable. use this file instead.
Changes:
In checkout_process.php add
$order = new order($insert_id);
before the replaced line.
In admin/orders.php add
include(DIR_WS_CLASSES . 'order.php');
$order = new order($oID);
before the replaced line.
you may also now remove the include(DIR_WS_CLASSES . 'order.php'); line farther down just before the <!doctype> tag.
Here's two changes to add the Improved Order Number to the email a customer gets when completing an order, and when an order is updated in admin.
This file only includes the following, not the original.
****************************************
Find the following In admin/orders.php:
$email = STORE_NAME . "n" . EMAIL_SEPARATOR . "n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "nn" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
Replace with:
$email = STORE_NAME . "n" . EMAIL_SEPARATOR . "n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . tep_trans_id($order->info['date_purchased'],$oID) . "n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "nn" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
******************************************
Find the following in checkout_process.php:
EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "n" .
Replace with:
EMAIL_TEXT_ORDER_NUMBER . ' ' . tep_trans_id($order->info['date_purchased'],$insert_id) . "n" .
******************************************************
*
* This contribution adds an order number that
* is more natural to myself. The order number
* will be printed on the invoices as well as
* show in the order list on the admin page.
*
* EXAMPLE ORDER NUMBER: 040919-474718-0009
*
* Contribution by
* Greg Peatfield
*
******************************************************
Note: Contributions are used at own risk.