Lookup order by Order Number

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
dadkind
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 105
Joined: Thu Jan 22, 2009 3:32 pm

Lookup order by Order Number

Post by dadkind » Thu Mar 12, 2009 9:13 am

Hello All,
We're trying to implement an "Order Lookup" page on our site.

How do I look up an order using the OrderNumber?

The default email that the customer gets uses the order number. But I've not been able to find a way to do an order lookup using the OrderNumber.

Surely, I'm just missing something.

The only catch, is that I am limited to "out of the box" components on this project. (Otherwise, I'm guessing a simple DB query would match/cross the orderNumber to an OrderID).


Thanks,
-tomas

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Lookup order by Order Number

Post by mazhar » Thu Mar 12, 2009 10:06 am

Just use the LoadForOrderNumber method and it will load the appropriate order.

dadkind
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 105
Joined: Thu Jan 22, 2009 3:32 pm

Re: Lookup order by Order Number

Post by dadkind » Thu Mar 12, 2009 10:42 am

mazhar wrote:Just use the LoadForOrderNumber method and it will load the appropriate order.
Is that a new function? It's not in the API docs.

The closest function is "LoadForGoogleOrderNumber()". Is this the same thing?

-tomas

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Lookup order by Order Number

Post by mazhar » Thu Mar 12, 2009 10:54 am

What is your AbleCommerce version?

dadkind
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 105
Joined: Thu Jan 22, 2009 3:32 pm

Re: Lookup order by Order Number

Post by dadkind » Thu Mar 12, 2009 11:34 am

mazhar wrote:What is your AbleCommerce version?
We're on version 7.0.2

(Are the Docs out of date?)

-tomas

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Lookup order by Order Number

Post by mazhar » Thu Mar 12, 2009 11:48 am

Sorry It was my mistake, it was LoadForGoogleOrderNumber and I misunderstood it. You can load order by order number as below

Code: Select all

OrderCollection orders = OrderDataSource.LoadForCriteria("OrderNumber = " + orderNumber + " AND StoreId = " + Token.Instance.Store.StoreId.ToString());

dadkind
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 105
Joined: Thu Jan 22, 2009 3:32 pm

Re: Lookup order by Order Number

Post by dadkind » Fri Mar 13, 2009 10:24 am

Thanks for the snippet!

I'm learning something new on this project every day. ;-)

-tomas
mazhar wrote:Sorry It was my mistake, it was LoadForGoogleOrderNumber and I misunderstood it. You can load order by order number as below

Code: Select all

OrderCollection orders = OrderDataSource.LoadForCriteria("OrderNumber = " + orderNumber + " AND StoreId = " + Token.Instance.Store.StoreId.ToString());

Post Reply