Page 1 of 1

Need to Capture the Order after submit

Posted: Fri Oct 24, 2008 3:30 pm
by BillEisenman
Where exactly does the order get sent to the DB. I need to capture it and sent it to our Order Processing DB also.

Re: Need to Capture the Order after submit

Posted: Fri Oct 24, 2008 7:39 pm
by AbleMods
BillEisenman wrote:Where exactly does the order get sent to the DB. I need to capture it and sent it to our Order Processing DB also.
Not sure precisely what you mean by "where" other than the obvious. The order is stored during the checkout process. The checkout page code is located in the ~/ConLib/OnePageCheckout.ascx user control.

Storing an order is actually performed via the basket instance calling a compiled method. It's not something you can interact with without full source code as it's part of the CommerceBuilder API.

You're probably better off retrieving the order AFTER checkout is complete within the ~/Checkout/Receipt.aspx page. At that point all Able code has acted upon the basket and the order has been stored to the Able db.

Re: Need to Capture the Order after submit

Posted: Sat Oct 25, 2008 6:08 am
by BillEisenman
It is as I expected. I have already created stored procedures in the ac7 db to retrieve the information that I need. I still would rather get it live though. Do you think that AbleCommerce would allow me access to thee code for customization?

Re: Need to Capture the Order after submit

Posted: Sat Oct 25, 2008 10:41 am
by AbleMods
BillEisenman wrote:It is as I expected. I have already created stored procedures in the ac7 db to retrieve the information that I need. I still would rather get it live though. Do you think that AbleCommerce would allow me access to thee code for customization?
I almost never go straight to the database. The CommerceBuilder data classes have alot of additional functionality that doesn't exist in the db.

The API source code is available for purchase. Just contact Able and they'll be happy to discuss it with you.

Re: Need to Capture the Order after submit

Posted: Sat Oct 25, 2008 11:32 am
by afm
BillEisenman wrote:Where exactly does the order get sent to the DB. I need to capture it and sent it to our Order Processing DB also.
The basket is converted to an order in the PaymentForms (i.e. \Checkout\PaymentForms\CreditCardPaymentForm.ascx). It looks pretty easy to capture the order:

Code: Select all

CheckoutResponse checkoutResponse = Token.Instance.User.Basket.Checkout(checkoutRequest);
if (checkoutResponse.Success)
{
    // Insert code to capture order here [i.e. CaptureOrder(checkoutResponse.OrderId);]
    if (CheckedOut != null) CheckedOut(this, new CheckedOutEventArgs(checkoutResponse.OrderId));
    Response.Redirect(NavigationHelper.GetReceiptUrl(checkoutResponse.OrderId));
}

Re: Need to Capture the Order after submit

Posted: Sat Oct 25, 2008 11:49 am
by BillEisenman
Thank you very much for your insight Andy. I will try it later this weekend or on Monday.