OrderId versus OrderNumber in 7.0.2

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

OrderId versus OrderNumber in 7.0.2

Post by AbleMods » Sat Mar 07, 2009 12:12 pm

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?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: OrderId versus OrderNumber in 7.0.2

Post by jmestep » Sat Mar 07, 2009 1:57 pm

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.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: OrderId versus OrderNumber in 7.0.2

Post by AbleMods » Sat Mar 07, 2009 3:33 pm

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
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

afm
Captain (CAPT)
Captain (CAPT)
Posts: 339
Joined: Thu Nov 03, 2005 11:52 pm
Location: Portland, OR
Contact:

Re: OrderId versus OrderNumber in 7.0.2

Post by afm » Sun Mar 08, 2009 3:05 am

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.
Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: OrderId versus OrderNumber in 7.0.2

Post by AbleMods » Sun Mar 08, 2009 9:35 am

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?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

afm
Captain (CAPT)
Captain (CAPT)
Posts: 339
Joined: Thu Nov 03, 2005 11:52 pm
Location: Portland, OR
Contact:

Re: OrderId versus OrderNumber in 7.0.2

Post by afm » Sun Mar 08, 2009 12:46 pm

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.
Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: OrderId versus OrderNumber in 7.0.2

Post by Logan Rhodehamel » Wed Mar 11, 2009 11:39 am

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.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: OrderId versus OrderNumber in 7.0.2

Post by AbleMods » Wed Mar 11, 2009 11:54 am

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.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: OrderId versus OrderNumber in 7.0.2

Post by Logan Rhodehamel » Wed Mar 11, 2009 12:01 pm

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.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

Post Reply