Page 1 of 1
In between Records in Arrays
Posted: Sun Jul 31, 2011 10:50 am
by mpw5013
I'm able to sort the first 6,000 records using the following command, but I can't figure out the next 6000.
This Works:
Code: Select all
$filterData = array(
'product_id' => array('lteq' => 6000)
);
This doesn't:
Code: Select all
$filterData = array(
'product_id' => array('gteq' => 6001, 'to'=> 7000)
);
Any ideas?
Re: In between Records in Arrays
Posted: Sun Jul 31, 2011 1:23 pm
by twinedev
All those commands do is assign a value to the variable $filterData. You would need to post the code of where those values are used for us to help.
-Greg
Re: In between Records in Arrays
Posted: Sun Jul 31, 2011 1:27 pm
by mpw5013
twinedev wrote:All those commands do is assign a value to the variable $filterData. You would need to post the code of where those values are used for us to help.
-Greg
Greg,
Not a problem:
Code: Select all
//load up local xml file for processing
$feed_xml = simplexml_load_file($superFile);
// Begin SOAP Requests
$client = new SoapClient($myDomain.'/api/?wsdl');
$session = $client->login($myAPILogin, $myAPIKey);
$updatedProducts = "";
//some counters - counting loops this way lets me see and set where the count increments
$x = 0;
//some filter date to pass to the API - add more to filter your results further - see Magento API docs
//$filterData = array('type'=>'simple');
/* This works...
$filterData = array(
'product_id' => array('lteq' => 6000)
);
*/
//This down doesn't.
$filterData = array(
'product_id' => array('gt' => 2001),
'product_id' => array('lteq' => 3000)
);
print_r($filterData);
/*
$filterData = array(
'product_id' => array(10001, 'to'=> 14000)
);
*/
//get all my database products into an array
$products = $client->call($session, 'catalog_product.list', array($filterData));
//loop through my product array
foreach ($products as $product) {...
Re: In between Records in Arrays
Posted: Sun Jul 31, 2011 4:17 pm
by twinedev
I've never used SoapClient myself, but from looking at the documentation (
http://www.php.net/manual/en/soapclient.call.php), the call method only takes 2 parameters, not 3 like you are doing, so I'm wondering if perhaps the original result if sorted by default to begin with?
If it is actually OK with 3, then another thing probably to double check is the docs for the API you are using as to what it is programmed to receive maybe?
Sorry I can't help ya more without having the live code to play with, but now that we know what you are using hopefully someone more familiar with it can help you.
-Greg