I would like to create custom order ids with alphanumeric data, e.g. CR4004.
I looked through modules/classes/order.php and I can't seem to find how it's setting the order id.
Any suggestions?
I would like to create custom order ids with alphanumeric data, e.g. CR4004.
I looked through modules/classes/order.php and I can't seem to find how it's setting the order id.
Any suggestions?
I've seen a few requests for this in the past. Sadly there is no option in admin to do what you want. As far as I'm aware, there's no contribution available either. I think you might have to make do with the current approach which is to increment the ID by 1 each time. You can always change the ID to start at a higher number, e.g. 60548. This can be done in admin>tools>store manager.
Mods: Admin Activity Report || PO Box Ban || Empty Cart Manager || Autoresponder+ || Zip Validator || Desktop Data || SRiC
please explain the algorithm that you want to use for order ID's, so we may see if it is possible.
I want the order id's to be something like CR999999. Just need to append "CR" to the order id really.
there are 2 ways of going about this., (that I can think of at the moment).
the easier i think would be to modify the code to display the added cr to the id number every where you want the cr to be displayed.
This way you will not have to mess w/ the database.
The other thing to do is to add a customer_number to the customers table on the database, and to have it be a varchar(64) and have your customer creations script do something like $customer_number = 'cr'. $customers_id; that way you dont have to think of messing w/ the auto incrementing that that the database already does for you.
both methods will will require you to change the loging script to match the customer_number w/ the database instead of the email address.
If you just want to add the CR to the order number there is alot easier way to do this, as I have done it to mine, I will dig out the files needed and come up with a short tutorial![]()