Contributions
Random Order Number
Random Order Number for your store. Based on the idea and ramdomizing script by Patrick Veverka. This will produce the order number like KY1002425.
Provided as is.
Expand All / Collapse All
The following comment applies to the version of this contribution that I posted on 25 May 2004. I can't comment on anyone else's versions !!!
The code I put up here on the 25th May DOES NOT WORK. I suggest you do not use it.
Instead, you might be interested in the "Scrambled Order Number" contribution which, I Believe, does work and affectively does the same thing :
http://www.oscommerce.com/community/contributions,2499
Rich/
I experienced orders couldn't be recognized when I use EDIT, DELETE, INVOICE, PACKING LIST from ADMIN area after I installed 05/25/2004 version of Random Order Number.
Few simple changes can solve the trouble.
1. Find all occurences of the string:
(int)$oID
replace to
$oID
2.. Find all occurences of the string:
(int)$order_id
replace to
$order_id
All the file names contain above strings are listed in the attached text file.
ooops !
Sorry - I should have mentioned - this will work for MySQL. It relies on checking the error status returned so if you use a different database then you'll need to adjust the check that is made. Mind you, you probably need to change the 'mysql' function calls too I would expect !
Sorry about the omission.
BTW - don't click in the link in this post - it doesn't point to anything - get the code from the previous post
This is based on the previous version of this contribution dated 16/04/2003 and generates order numbers of a similar format (though you can easily adjust the format)
This version deals with the problem of generating duplicate order numbers, which (as far as I know) all the previous versions suffer from.
(the version dated 5/03/2004 claims to get round this problem by adding an offset to the existing order number but I disagree that this works for the following reasons - (a) this is not bullet proof (it can STILL fail) and (b) it does not explain how you get an initial random order number into the database in the first place from which you can add your 'offset')
In the version I present here, if a duplicate is detected then it generates a different number and tries again. There is an adjustable limit but in reality it will never fail (well, ok, it might fail if you've taken 20,000 orders already in the same day, but realistically...)
Rich.±
Update - Relevant if you use paypalipn and/or held orders.
Random |
Emett - yesUdo.com |
6 Mar 2004 |
|
Amendment on install instructions.
A different version of generating a random order number.
This takes the last order id and adds a random number between 7 & 15(although you can amend this) to it to create the next order id.
This eliminates the slim chance of duplicate order ids which is a possibility in the contrib by Michael.
Random Order Number for your store. Based on the idea and ramdomizing script by Patrick Veverka. This will produce the order number like KY1002425.
Provided as is.
Note: Contributions are used at own risk.