Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

lame order numbers...


Recommended Posts

Hi all,

For stores starting out, the stock osc order number is pretty lame. There is a contribution here that adds the date and time stamp to the order number, which is both more functional and professional.


It adds this improved order number to the invoice, packing slip, and the customers account and account history.


What I would like is to also add this number to the checkout success page, and the email confirmation that the customer receives, so that they don't see different order numbers between pages.


I've tried to ammend this code in checkout success.php:


echo TEXT_YOUR_ORDER_NUMBER . $orders['orders_id'] . '<br><br>';


to this (with a few variations):


echo TEXT_YOUR_ORDER_NUMBER . tep_trans_id($orders['date_purchased'],$orders['orders_id']) . '<br><br>';


And in the best case, I get a blank order number.

And as for the email that is sent to customers, where do I need to edit to add this functionalty?


If anyone is willing to take a look at the contribution-I'd appreciate it. I can post the code for ease of use if you like.



Quidquid latine dictum sit, profundum viditur.

Link to comment
Share on other sites

this is the function that the contribution adds to the catalog and admin includes/functions/general.php



// Output Transaction_ID = YYMMDD-SSmmHH-0001
// $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS
// $order_id is passed from the customer order
 function tep_trans_id($raw_date,$order_id) {
   if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;

   $year = (int)substr($raw_date, 2, 2);
   $month = (int)substr($raw_date, 5, 2);
   $day = (int)substr($raw_date, 8, 2);
   $hour = (int)substr($raw_date, 11, 2);
   $minute = (int)substr($raw_date, 14, 2);
   $second = (int)substr($raw_date, 17, 2);

   return $cart_id;



It works just fine, but I need the code to make it display in the aforementioned checkout_success.php and in the customers confirmation email.



Quidquid latine dictum sit, profundum viditur.

Link to comment
Share on other sites

  • 1 year later...


This topic is now archived and is closed to further replies.

  • Create New...