php - how to retrive customer orders in magento api V1 -


i using magento api v1. want retrieve specific customer orders. using order.list method. in method filter not working.it giving me complete order list. don't know mistaking. here code

$client = new soapclient('http://magentohost/api/soap/?wsdl');  $session = $client->login('apiuser', 'apikey');  $filter = array('filter' => array(array('key=' => 'customer_id', 'value' => 210)));  $result = $client->call($session, 'order.list',$filter); var_dump ($result); 

finally got way retrieve customer orders

$client = new soapclient('http://magentohost/api/soap/?wsdl');  $session = $client->login('apiuser', 'apikey'); $customer_id = 210;  $result = $client->call($session, 'order.list');  if($result) {        foreach($result $val) {   if($customer_id==$val['customer_id'])   {     $res[] = $val;   }  var_dump ($res);  } 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -