Page 1 of 1
Filter Stone Edge Import of Orders
Posted: Wed Jun 24, 2009 2:07 pm
by ZLA
I know that Stone Edge Order Manager can download orders from AC. By default I think it grabs all orders. Is it possible to customize the download to only grab orders for a single vendor? I'm looking into having a drop ship vendor download directly from our site for their orders.
Is that possible? If so, what would be required?
Re: Filter Stone Edge Import of Orders
Posted: Wed Jun 24, 2009 3:00 pm
by sdlong02
I talked to Stone Edge regarding certain filters to which orders it would download. If I understand their script, there's nothing in there to pick and choose.
If I recall correctly they said it is not possible, but the issue is a month or two old so I'm not positive.
Re: Filter Stone Edge Import of Orders
Posted: Thu Jun 25, 2009 1:43 pm
by kastnerd
I asked about this a long time ago.
http://www.stoneedge.net/forum/topic.as ... 771煤
You can make modifications to the SETIService.ashx script though. Modify the SQL Statement that pulls the orders for download by looking for the following code:
=====================================================================================
If UCase(LastOrder) = "ALL" Then LastOrder = "0"
x = ""
If IsNumeric(LastOrder) Then
     x = " OrderID > " & LastOrder & " AND "
ElseIf UCase(OrderDate) "ALL" Then
     x = "OrderDate >= '" & Format(CDate(OrderDate), "MM-dd-yyyy HH:mm:ss") & "' AND "
End If
x = x & "StoreID=" & objToken.StoreId
If IsNumeric(StartNum) And IsNumeric(BatchSize) Then
     colOrders = CommerceBuilder.Orders.OrderDataSource.LoadForCriteria(x, BatchSize, StartNum, "OrderID")
Else
     colOrders = CommerceBuilder.Orders.OrderDataSource.LoadForCriteria(x, "OrderID")
End If
======================================================================================
You can tweak this code to limit which orders are pulled. Do keep in mind that customizing your script in this way will require the same modifications to any future releases that may become available.
Re: Filter Stone Edge Import of Orders
Posted: Thu Jun 25, 2009 1:50 pm
by kastnerd
Only problem i see is if someone orders 5 products and only 1 is from that vendor?
Re: Filter Stone Edge Import of Orders
Posted: Thu Jun 25, 2009 9:09 pm
by ZLA
That matches what Stone Edge told me:
Stone Edge wrote:
The AbleCommerce API allows selection of orders based on a SQL Statement (the WHERE clause) is fed to the OrderDataSource object. The query (x) used by the SETIService.ashx file is built as follows:
Code: Select all
If UCase(LastOrder) = "ALL" Then LastOrder = "0"
x = ""
If IsNumeric(LastOrder) Then
x = " OrderID > " & LastOrder & " AND "
ElseIf UCase(OrderDate) <> "ALL" Then
x = "OrderDate >= '" & Format(CDate(OrderDate), "MM-dd-yyyy HH:mm:ss") & "' AND "
End If
x = x & "StoreID=" & objToken.StoreId
(ADD YOUR CODE HERE)
x = x & " AND Additional Criteria…"
If IsNumeric(StartNum) And IsNumeric(BatchSize) Then
colOrders = CommerceBuilder.Orders.OrderDataSource.LoadForCriteria(x, BatchSize, StartNum, "OrderID")
Else
colOrders = CommerceBuilder.Orders.OrderDataSource.LoadForCriteria(x, "OrderID")
End If
The issue here is that you are limited to criteria specific to the Orders table. You cannot do Inner/Outer Joins on other tables, therefore, your order would need to have something in it to indicate it is for this specific vendor. Perhaps the billing name/address can be used?
To limit this vendor to their orders only, copy the SETIService.ashx file to a new file, edit the SQL then give the vendor the new service script name – be sure to set up the appropriate permissions for this new script in the web.config for AbleCommerce. This would minimize the need for additional edits in the script to restrict output based on login credentials.
However there is still the issue of multiple vendors:
kastnerd wrote:Only problem i see is if someone orders 5 products and only 1 is from that vendor?
Is it possible to copy or clone the order and iterate through it, deleting items or shipments that don't belong to the desired vendor and then passing copy instead of colOrders? The ordercollection and order objects seem to support the following:
Code: Select all
colOrders.CopyTo(myArray, 0);
Order o = colOrders[0];
o.Items[i].Delete();
I haven't tried it yet but does anyone think that would work?
Re: Filter Stone Edge Import of Orders
Posted: Fri Jun 26, 2009 6:01 am
by jmestep
I think you would be able to do something like that. In the past I had done some customizations to that StoneEdge file for various things the merchant wanted. It was awkward because I didn't know all the ways SE was expecting things, so it was a program and test procedure.
Re: Filter Stone Edge Import of Orders
Posted: Fri Jun 26, 2009 6:50 am
by ZLA
[quote="jmestep"]In the past I had done some customizations to that StoneEdge file for various things the merchant wanted.[quote]
Does SETIService.ashx just return XML file(s) that are downloaded by SEOM? I've actually got some code that can already create the necessary file without having to build an order object.
Unfortunately, I don't have SEOM so I can't even program and test. For me it would be program and have vendor test.
Thanks Judy.
Re: Filter Stone Edge Import of Orders
Posted: Fri Jun 26, 2009 10:00 am
by jmestep
I'm not sure- I don't have anything on my computer any more that has to do with it. I think she connected to the .ashx page with SE, which is in MS Access, and I just don't remember after that. I know there were times she had to hand edit some data before doing the final import routine because of business rules that changed from time to time or special ways they wanted the data formatted.
Re: Filter Stone Edge Import of Orders
Posted: Fri Jun 26, 2009 12:35 pm
by sdlong02
Not too savvy on the topic, but I do know that once it finds the orders it creates a block of script/code to use for importing the orders into SE and also creates an XML backup of the script/code.