cancel
Showing results for 
Search instead for 
Did you mean: 

Soap V1 cataloginventory_stock_item.list question

Soap V1 cataloginventory_stock_item.list question

Hi....

If I pass an array of product_id to cataloginventory_stock_item.list in Soap V1, it only returns the first product id in the array and ingnores the others.

 

In the magento code, it exspects and array (which I am sending), so I hardcoded an array in the magento code, and it worked. All the products specified was returned. If I pass the array from a PHP script, I does not work. Am I missing something here....

 

<?php
$client = new SoapClient('http://mydomain/api/soap/?wsdl');
$session = $client->login('soapapi', 'qwerty');
$params = array('250,251,252');
$result = $client->call($session, 'cataloginventory_stock_item.list',$params);
var_dump($result);
$client->endSession($session);
?>

 

And this is the result.....It should have 3 products, but only returns 1.

array(1) {
  [0]=>
  array(4) {
    ["product_id"]=>
    string(3) "250"
    ["sku"]=>
    string(6) "mtk001"
    ["qty"]=>
    string(7) "23.0000"
    ["is_in_stock"]=>
    string(1) "1"
  }
}

Any help will do....I have the latest CE version.

Tags (1)
1 REPLY

Re: Soap V1 cataloginventory_stock_item.list question

Nevermind.....I got it.

 

You must declare your params like:

 

$params = array('filter'=>array('250',260','270'));