Post by lm555cn » Wed Aug 26, 2009 2:13 am

I am trying Opencart, which i find fantastic! ;) and had made some dummy purchases and noticed that the Order ID's for them started from 0 (Zero) and then incremented accordingly. Is there any way to choose a different number for the Order ID to start from in order to match the physical receipts or bills and take it from there?

Sorry for the answer but I have already tried to search in the backoffice and have had no luck.

I am trying to put a small cart system for my brother which is not to computer saavy, I am not either, but I like to get dirty my hands just to learn something new, even if I commit mistakes.

Anyway, I was looking for a cart system which was free, fast, easy to manage, easy to create templates, etc. and robust, I was going for Prestashop, but had a tough time with the templates and smarty. I am not much into programming, but with some Google searches for HTML,CSS and PHP I have been able to make some changes fairly easy, though I have to learn a lot more! :o

Great job with this cart system.

Newbie

Posts

Joined
Sun Aug 23, 2009 11:07 am

Post by Qphoria » Wed Aug 26, 2009 3:40 am

change the autoinc number in the database via phpmyadmin for the order table

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by lm555cn » Wed Aug 26, 2009 8:42 pm

Thanks a lot Qphoria!
Don't know SQL but I think I can manage by doing some searches. ;D

Newbie

Posts

Joined
Sun Aug 23, 2009 11:07 am

Post by Qphoria » Wed Aug 26, 2009 9:22 pm

Just run this:

Code: Select all

ALTER TABLE `opc_order`  AUTO_INCREMENT =500;
set the 500 to whatever you want it to start at

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by lm555cn » Thu Aug 27, 2009 5:26 am

Thanks once again Qphoria. ;D
I was in fact having some trouble doing it, but didn't want to bother. ::)
I REALLY appreciate all your help.
Regards.

Newbie

Posts

Joined
Sun Aug 23, 2009 11:07 am

Post by cadsifu » Thu Oct 08, 2009 12:17 pm

Qphoria wrote:change the autoinc number in the database via phpmyadmin for the order table
where to find autoinc? which file?

Newbie

Posts

Joined
Thu Oct 08, 2009 12:00 pm

Post by HeidiD » Sat Jan 30, 2010 9:56 am

How would one do this in the new version? Not very familiar with php myadmin.

Newbie

Posts

Joined
Fri Jan 29, 2010 8:09 am

Post by justme54s » Fri Apr 30, 2010 10:46 pm

HeidiD wrote:How would one do this in the new version? Not very familiar with php myadmin.

Code: Select all

ALTER TABLE `order`  AUTO_INCREMENT =10000

Newbie

Posts

Joined
Fri Apr 30, 2010 9:35 pm

Post by tophat » Thu Mar 01, 2012 10:43 pm

Super. Thanks for this.
Last edited by tophat on Fri May 18, 2012 2:12 am, edited 2 times in total.

User avatar
Active Member

Posts

Joined
Fri Nov 25, 2011 8:31 am


Post by stremblay » Sun Apr 01, 2012 5:44 am

Hello,

what about if I want to add, let's say "WEB" before Orderid. Could I get "WEB1, WEB2, WEB3, WEB4, WEB5" ?

Any ideas?

Newbie

Posts

Joined
Sun Apr 01, 2012 5:39 am

Post by jty » Sun Apr 01, 2012 8:15 am

stremblay wrote:what about if I want to add, let's say "WEB" before Orderid. Could I get "WEB1, WEB2, WEB3, WEB4, WEB5" ?
Hello Stremblay, welcome to Open cart.
no you can't add alpha to the order_id as the order_id is a number only.
However, you can achieve what you want through other ways but I don't know what other ways as I don't know why you want to add an alpha prefix to your order_id.
My guess is that you are running multi-store and want to separate the orders per store. In such a scenario, you could make use of the store_id.
If you look in the order table, you will see a store_id, so you can stick that onto the order_id and have something like
'WEB' + store_id + order_id.
You would need to know a bit of php to be able to do this.

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by stremblay » Sun Apr 01, 2012 11:44 pm

Thanks jty ! This is a really awesome idea :)

Newbie

Posts

Joined
Sun Apr 01, 2012 5:39 am

Post by tunnu » Thu May 17, 2012 3:25 am

Is there any maximum limit or digit limit in this?

like i want to add like 2012050001 for 2012 May from order number 1, and for next month i need to increment it to 201206 etc

New member

Posts

Joined
Sun Jun 05, 2011 11:38 pm

Post by myocid » Fri Jun 22, 2012 9:22 am

O, Hello everyone!
What the matter? ??? Can somebody post a screenshot guider? :-*
Best Wishes for all you

Attachments

screenshot.22-06-2012 09.18.59.png

screenshot.22-06-2012 09.18.59.png (25.18 KiB) Viewed 17314 times


Newbie

Posts

Joined
Fri Jun 22, 2012 9:14 am

Post by strato » Fri Jun 07, 2013 2:34 pm

I did this and it worked perfectly.
Just go to the "order" table. Click on the SQL tab at the top.
In the SQL window, backspace out the SELECT * blah blah blah.. and put in this:

ALTER TABLE `order` AUTO_INCREMENT =10000

I use the new version of OpenCart (1.5.5.1) and the table's actually "oc_order", so I changed it to this:

ALTER TABLE `oc_order` AUTO_INCREMENT =672 <---- I thought this was much more realistic, since my business is only a year old! :laugh:

Hit the "Go" button.. and that's it! It won't look like anything has changed, but your next order will start with 672.

User avatar
Newbie

Posts

Joined
Sat Apr 20, 2013 5:33 am

Post by crispylettuce » Sat Oct 12, 2013 4:34 am

When i apply this, it doesnt change the order number. Why could that be?

I also have three shops on multi site format, and one store has started 're-using' old Order ID's and therefore not appearing in orders anywhere?

Active Member

Posts

Joined
Fri Aug 03, 2012 8:54 pm
Who is online

Users browsing this forum: No registered users and 27 guests