Page 1 of 1

Order ID Change?

Posted: Fri Mar 15, 2019 4:07 pm
by eighteenhk
Hello Everyone.

May I ask how to change the id? I already know I can add prefix, but I want the order id become either the date or random.
For example: Order time: 2019-03-15 16:05:23 Order ID: 2019031516052301 etc...
If this is impossible, can I make it randomly? I don't want the customer know how many orders of my store. Thanks!! :)

Re: Order ID Change?

Posted: Fri Mar 15, 2019 4:09 pm
by thekrotek
You don't change order_id and you can't make it random.

Re: Order ID Change?

Posted: Fri Mar 15, 2019 5:34 pm
by eighteenhk
thekrotek wrote:
Fri Mar 15, 2019 4:09 pm
You don't change order_id and you can't make it random.
so it is impossible to hide my order number from customer?
How about the invoice number?

Re: Order ID Change?

Posted: Fri Mar 15, 2019 6:54 pm
by paulfeakins
eighteenhk wrote:
Fri Mar 15, 2019 5:34 pm
How about the invoice number?
You should be able to make something different appear on the confirmation emails by editing that template.

Re: Order ID Change?

Posted: Fri Mar 15, 2019 7:09 pm
by thekrotek
eighteenhk wrote:
Fri Mar 15, 2019 5:34 pm
How about the invoice number?
By default, invoice number is just some prefix plus order ID. You can hide it though.

Re: Order ID Change?

Posted: Sat Mar 16, 2019 3:55 am
by kestas
thekrotek wrote:
Fri Mar 15, 2019 7:09 pm
eighteenhk wrote:
Fri Mar 15, 2019 5:34 pm
How about the invoice number?
By default, invoice number is just some prefix plus order ID. You can hide it though.
It is not by default.
By default you generating invoice number. So, invoice number can be just sequentially generated + some prefix which you set on your shop settings. And invoice number can be different than order number.

Re: Order ID Change?

Posted: Sat Mar 16, 2019 4:00 am
by kestas
eighteenhk wrote:
Fri Mar 15, 2019 4:07 pm
Hello Everyone.

May I ask how to change the id? I already know I can add prefix, but I want the order id become either the date or random.
For example: Order time: 2019-03-15 16:05:23 Order ID: 2019031516052301 etc...
If this is impossible, can I make it randomly? I don't want the customer know how many orders of my store. Thanks!! :)
If you want to show for your customers some "high" order ID number you can edit the last your order in your phpMyadmin by changing order id to some "high" number. The next orders will show sequentially higher order number. Randomly order_id cannot be generated.

Edited. The better way... do not edit real order. For this you need to make "fake" order by yourself and edit order_id on this one in your phpMyadmin table "order". Before you edit it, you must make backup of your database in case if something goes wrong.

Re: Order ID Change?

Posted: Mon Mar 18, 2019 5:40 pm
by chongshengdz
you can move to cubecart, they have the order id you want.
opencart is impossible.

Re: Order ID Change?

Posted: Mon Mar 18, 2019 8:18 pm
by OSWorX
I am a bit surprised of some answers here!

Just to clarify: order_id is only the internally generated database table (entry) id.
Is sequential and cannot be changed.
Ot better it can be changed, but that makes no sense at all.

Why has this number be a int(eger)?
As said, is simply the internal id for the database.

Is this id further used?
Yes, at every call of the order (back- and frontend as well as in the order email).

What is the Invoice number?
A custom defined string (letters and numbers).
Can have a prefix (defined in the system settings) or can have some custom output (as done by some invoice extensions).
Some of these extensions (as mine also) allow you to define the output as you want (or need, e.g. in case you need a special number for your bookkeeping software).

Which all at least means, if you do not want to share your order_id, simply use something else.
Simply create an extension which hide all order_id(s) and replace them with your fantasy number/logic/whatelse.

But beware, the moment you want to allow your customers to have access to their order history (e.g. via customer account and/or order confirmation email), you will have troubles .. because no real order_id is used.

If you really want to go this way, you have to 'translate' internally also those fantasy numbers .. otherwise your shop is broken.

Decide however you want and simply create the working extension for it (or hire someone if you are not able to do so).

Re: Order ID Change?

Posted: Mon Mar 18, 2019 8:52 pm
by thekrotek
Short version: you don't change order ID.

Re: Order ID Change?

Posted: Mon Mar 18, 2019 11:52 pm
by OSWorX
thekrotek wrote:
Mon Mar 18, 2019 8:52 pm
Short version: you don't change order ID.
Shortest: maybe.