Page 1 of 1

OrderId versus OrderNumber in 7.0.2

Posted: Sat Mar 07, 2009 12:12 pm
by AbleMods
Perhaps this has already been explained, but what is the functional difference between OrderId and OrderNumber now that we have both in 7.0.2 ac_Orders?

Will they always be the same? What will be used on email templates? What about existing programming designed to reference OrderId?

Re: OrderId versus OrderNumber in 7.0.2

Posted: Sat Mar 07, 2009 1:57 pm
by jmestep
This is my guess based on what it was in Able 5. There were two different sets of numbers partly so that it could be a multi-store database. I've worked on a site that was upgraded from an older version of Able 7 and the orderids and ordernumbers did not match. They might keep synchronized if the site starts out new, but I'm not sure of that.
From what I can tell of the new source code, the OrderId rules. I is the identity primary key in the ac_Orders table.

Re: OrderId versus OrderNumber in 7.0.2

Posted: Sat Mar 07, 2009 3:33 pm
by AbleMods
jmestep wrote: It is the identity primary key in the ac_Orders table.
I saw that too, which puzzled me even further as to how OrderNumber is to be treated. OrderNumber just looks like a standard field, no auto-increment or anything. /shrug

Re: OrderId versus OrderNumber in 7.0.2

Posted: Sun Mar 08, 2009 3:05 am
by afm
OrderId and OrderNumber do not need to be the same. For example, if you set "Next Order Number" in the website settings to 702001, the next order will get that OrderNumber even if the next OrderId is 3.

Re: OrderId versus OrderNumber in 7.0.2

Posted: Sun Mar 08, 2009 9:35 am
by AbleMods
afm wrote:OrderId and OrderNumber do not need to be the same. For example, if you set "Next Order Number" in the website settings to 702001, the next order will get that OrderNumber even if the next OrderId is 3.
Hmmm ok. You can't alter the starting OrderId value?

Re: OrderId versus OrderNumber in 7.0.2

Posted: Sun Mar 08, 2009 12:46 pm
by afm
SolunarServices wrote:Hmmm ok. You can't alter the starting OrderId value?
Not using the 7.0.2 UI. Prior to 7.0.2, that is what Next Order Number did (it modified the next OrderId because Order Number and Order ID were the same). As of 7.0.2, Next Order Number only affects the OrderNumber field.

Re: OrderId versus OrderNumber in 7.0.2

Posted: Wed Mar 11, 2009 11:39 am
by Logan Rhodehamel
jmestep wrote:This is my guess based on what it was in Able 5. There were two different sets of numbers partly so that it could be a multi-store database.
The change could be used for multi store databases, but more importantly it brings AC7 back into line with AC5 for our third party integrations like Order Manager and CRM. Order ID is the primary key in the database. Order Number is a merchant reference number generated from whatever rules you specify in the order admin (e.g. start at 1000, increase by 15, etc.)

Order ID and Order Number could be the same, but it's not necessary. Customers (and merchants) should see Order Number displayed universally. OrderID is only intended for use by the code, and not as a display feature.

Re: OrderId versus OrderNumber in 7.0.2

Posted: Wed Mar 11, 2009 11:54 am
by AbleMods
Hmm ok - so for developers like me, I need to start pulling OrderNumber instead of OrderId if the data being pulled will be seen. Otherwise I risk pulling an OrderId that nobody ever sees on the front/admin side of the website.

Still feels redundant and somewhat over-complicated though. I guess ac_Orders is probably the only place where opposing identification numbers would be necessary.

Re: OrderId versus OrderNumber in 7.0.2

Posted: Wed Mar 11, 2009 12:01 pm
by Logan Rhodehamel
SolunarServices wrote:Still feels redundant and somewhat over-complicated though. I guess ac_Orders is probably the only place where opposing identification numbers would be necessary.
If you are going to display it to the merchant / customer, show the order number value. The dual fields are necessary in order to allow the merchant to specify the starting order number and increment.