Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

API via PHP - multiple parameters in customer.list
 
strongnc21
Jr. Member
 
Total Posts:  2
Joined:  2009-02-05
 

I am trying to use “customer.list” to get a list of contacts through the API using multiple parameters.

I would like to do something like this:

select from customers where customer_id 10000 and customer_id 15000

In PHP, I can get the following to work:

$param = array('customer_id' => array('lt' => 15000));
$results $proxy->call($sessionId'customer.list', array($param));

But I can’t figure out how to add in a second condition.  How would I specify < 15000 AND > 10000?  Also, is it possible to do OR as well?

Thank you,

~ Nick

 
Magento Community Magento Community
Magento Community
Magento Community
 
strongnc21
Jr. Member
 
Total Posts:  2
Joined:  2009-02-05
 

I just tried this:

$param = array('customer_id' => array('gt' => 10000), 'customer_id' => array('lt' => 15000));
$results $proxy->call($sessionId'customer.list', array($param));

But still no dice.  This call isn’t picking anything up above 15000 (good), but it is still picking up records less than 10000.

If I try this:

$param = array('customer_id' => array('gt' => 10000'lt' => 15000));
$results $proxy->call($sessionId'customer.list', array($param));

I get this error:

Fatal errorUncaught SoapFault exception[SOAP-ENV:Server] Allowed memory size of 134217728 bytes exhausted (tried to allocate 45 bytesin D:\HTTP\test.php:13 Stack trace#0 [internal function]: SoapClient->__call('call', Array) #1 D:\HTTP\test.php(13): SoapClient->call('9cfe21dddaeda10...', 'customer.list', Array) #2 {main} thrown in D:\HTTP\test.php on line 13

Or in other words, it’s trying to pull far too many records because the conditions that I’m trying to specify aren’t working.

~ Nick

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