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!!
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
You should be able to make something different appear on the confirmation emails by editing that template.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
By default, invoice number is just some prefix plus order ID. You can hide it though.
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
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.
Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here
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.eighteenhk wrote: ↑Fri Mar 15, 2019 4:07 pmHello 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!!
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.
Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here
opencart is impossible.
Electronic Components: integrated circuits, ic, semiconductors, transistors, thyristors, fuses, resistors, diodes, capacitors & more.
buy & sell transistors & mosfet
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).
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Shortest: maybe.
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
A - find this line
Code: Select all
foreach ($results as $result) {
Code: Select all
$order_no = str_replace("-","",$result['date_added']);
$order_no = str_replace(":","",$order_no);
$order_no = str_replace(" ","-",$order_no);
Code: Select all
'view' => $this->url->link('sale/order/info', 'user_token=' . $this->session->data['user_token'] . '&order_id=' . $result['order_id'] . $url, true),
Code: Select all
'order_no' => $order_no."-".$result['order_id'],
find this line :
Code: Select all
<td class="text-right">{{ order.order_id }}</td>
Code: Select all
<td class="text-right">{{ order.order_no }}</td>
Users browsing this forum: Bing [Bot], niagato, Semrush [Bot] and 649 guests