Magento Forum

   
[API] Order list and Filter use
 
Jelmo
Jr. Member
 
Total Posts:  28
Joined:  2008-08-15
 

Hello Everyone,

I’m trying to use the Magento API to externally get some data out of the store. I managed to get a list of featured products (see last forum topic).

Now i want to get the topsellers from the store but i’m stuck with not very well documented API features.

The API works, albeit very slow, and i can select the orders for instance like so:

$orderList $client->call('call', array($session'sales_order.list'));
This works fine, but when i want to add some filters to this call, which is said to work in the documentation, i can’t get it to work.
The documentation says:
// Getting list of orders created by John Doe
var_dump($proxy->call($sessionId'sales_order.list', array(array('billing_name'=>array('like'=>'&#xJo;hn&#xDo;e%')))));

When i modify this to something like this:

$orderList $client->call('call', array($session'sales_order.list', array(array('increment_id'=>array('greater than' => 100006575)))));
only order 100006575 is returned.

So my question is, what filters are there that i can use, and how can i properly use them ?

Any help will be greatly appreciated!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Chris Farley
Member
 
Total Posts:  43
Joined:  2008-03-09
 

I don’t know if “greater than” is the correct syntax. I can’t find where the filter syntax is documented. (Probably in the source code, I guess. I haven’t really looked there!)

From my experiments, you can replace ‘greater than’ with any string and get the same result. Just a single order. I tried ‘>’, ‘greaterthan’, ‘xyzzy’, etc.

Can anyone shed light on the correct API syntax for filtering on stuff other than like and ‘=’? Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Chris Farley
Member
 
Total Posts:  43
Joined:  2008-03-09
 

The answer is here… use “gt” for greater than.

http://www.magentocommerce.com/boards/viewthread/16207/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jelmo
Jr. Member
 
Total Posts:  28
Joined:  2008-08-15
 

Holy .....

U are my hero Chris ! was searching for this for ages! It works like a charm (gt was prob. the only one i didn’t try smile )

Thanks!!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top