-
- Destreyf

-
Total Posts: 26
Joined: 2009-01-20
|
Hello, I’m quite new to the workings of Magento, and i am having some troubles with the SOAP API calls particularly the customer.list resource (as described in the title), i was wondering what the attributes were for the array argument of the call.
my understanding of it is that you would pass in the first name/last name and such, but this doesn’t seem to be the case, i can’t get the results from my remove search to filter at all.
Here is my code as i have it for now, to do the testing, but it still pulls up both clients, even though i’m trying to get only the firstname of “John”, another question is, does the API support wildcards?
John, Cameron (test data)
<?php $client = new SoapClient('path_to_soap'); $sessionId = $client->login('xxxxxxxx', 'xxxxxxxxxxxx'); $data = $client->call($sessionId, 'customer.list', array('firstname'=>'John')); ?> <div class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-top">Search Customers</div> //Search options will go here when complete. <div class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header">Search Results</div> <table> <tr> <td><strong>First Name</strong></td> <td><strong>Last Name</strong></td> <td><strong>Email Address</strong></td> <td><strong>Date Created</strong></td> <td></td> </tr> <?php foreach($data as $k=>$v){ ?> <tr> <td><?=$v['firstname'];?></td> <td><?=$v['lastname'];?></td> <td><?=$v['email'];?></td> <td><?=date('F dS Y',strtotime($v['created_at']));?></td> <td><a href="?p=<?=$this->HideURL('clients/view_client');?>&id;=<?=$v['customer_id'];?>">View</a></td> </tr> <? } ?> </table> <?php $client->endSession($session); ?>
Any help with this would be greatly appreciated.
|