HomeHome Product Discus... Product Discus...SmithCartSmithCartOnCheckout stored procedureOnCheckout stored procedure
Previous
 
Next
New Post
2/9/2011 11:33 AM
 

Does the OnCheckout stored procedure that we define pass the orderid over?

If not, is there a reason why it was left out? Its passed in the webservice call, and I don't want to use the lastIdentity call in SQL as it doesn't guarantee me its the same order.

thanks,

jasen

 
New Post
2/9/2011 9:11 PM
Accepted Answer 

Hey Jasen,

Please take a look at these forum posts for more information on the OnCheckout stored procedure:

https://www.smith-consulting.com/foru...

http://www.smith-consulting.com/forum...


Christian

 
New Post
2/10/2011 6:18 AM
 

Hi again Christian (you're a one-man-forum-answering-army today!)

Those links are great, but they don't really answer the question yes or no, and I'm a but confused. The the OnCheckout stored procedure that we build accept a parameter such as OrderID?

The webservice call does, I have seen that, but really don't want to go that route right now.

I also do not want to rely on SELECT IDENT_CURRENT(‘tablename’) as it is really not a safe programming practice if another order comes in. We are building a site with mico-payments and could potentially be very high-volume, so I can't take that design risk up front.

Thanks again!

jasen

 
New Post
2/10/2011 7:20 AM
 

The On Checkout stored procedure doesn't pass any parameters.

The way that I work this is by adding another field in the Smith_StoreOrders table. In my case, it's called "SentToMas", but you could call it whatever you want.

Then, in your SP, select the orders where [SentToMas] = 0, and when you process each record, set [SentToMas] = 1.

I also have a field in there called "Printed", which gets updated after the order is rendered into a pick sheet and sent to the warehouse printer.

This way, if something goes wrong, your stored procedure doesn't fire, or has an error (for example, when I send orders over to MAS90, if the user has put in an invalid zip code, the procedure stops)... you can call your SP manually after the problem is fixed, and the orders "catch up".

So, all in all, it's a way to process ALL unprocessed orders, instead of a single order by passing an orderID or whatnot to the SP.

 
New Post
2/10/2011 11:12 AM
 

thats a great little trick. thanks!

 
New Post
2/11/2011 6:02 AM
 

Thank you. It works very well doing it that way.

Plus, it's unaffected if you update the cart, because the cart never *removes* a field; it will add new fields if that is part of the build.

 
Previous
 
Next
HomeHome Product Discus... Product Discus...SmithCartSmithCartOnCheckout stored procedureOnCheckout stored procedure