Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

osc 2.3.1 Unique Order Number


UsingOSC

Recommended Posts

  • 2 years later...

Hrm...seems like a pretty old thread, but ...you have to take the "-" out of the date("dmy-His") entry.  Otherwise it truncates the number, excluding time, and all orders place on the same day would have the same number.

 

My problem is that it breaks PayPal.  Works great for invoice numbers but I get [TEP STOP] when I try to check out with PP.  I double-checked paypal_standard.php and all instances of (int)$order_id have been changed to $order_id.  Not real sure where to look for the problem.

 

And what's the chances I need to do the same to the IPN listener?...or any other PP associated files?

 

Suggestions?

Edited by Supertex
Link to comment
Share on other sites

Best is, not to use this add-on or any other in this direction.

 

Leave the order number in the database in peace, same with any other auto incrementing ids, sooner or later you will mess up while changing them

 

If you want a different order number to appear on your invoices or anywhere else, then do it in php, in the file you are showing the order number. 

 

You could create a function say "format_order_number($order_id)" that will reformat the order number by adding a date, or id, or the name of your pet and then, at each place where the order id is going to the screen, pass it through this function first

Link to comment
Share on other sites

Yeah...I thought about this all night.  Too easy to orphan an order - or worse.  

 

I was thinking of adding orders_invoice_id to the appropriate tables and instead of changing the order number/id, just adding a function that will use this addon's mechanic to create the invoice number at the same time the order_id is created. Then just change the files that display order number, and the only place order_id matters is in the mechanics.

 

Only thing I'd like to change is that instead of using the timestamp in the invoice number, I'd rather it just use ymd + 001 and increment by one per order per day.  9 is a more reasonable length than 12.  Not sure what the logic to do that would involve.

 

Would still be a pain to keep track of modifying new files, but at least no issues from orders that are not recorded...

Edited by Supertex
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...