I am using SOAP php commands to create shipments in Magento and have no problem creating entire shipments, but I am having trouble creating partial shipments. I know that it is related to the array that I have created. I have tried everything that I can think of but I have not been successful. Is there anyone out there that can review my code and let me know what I am doing incorrectly?
There are 2 arguments that I am sending into my script. Argument 1 is the order number and argument is a text file listing the item number and qty. Sample following:
1010144~4
1010266~5
Here is my code:
$filename = "\\php\\upload\\";
$filename .= $argv[2];
$filename .= '.txt';
$data = array();
if (($handle = fopen($filename,'r')) != FALSE)
{
while (($row = fgetcsv($handle,100,'~')) != FALSE)
{
$filter = array(array(
'sku'=>array('eq'=>$row[0])
));
$result = $client->call($session, 'catalog_product.list', $filter);
$row[0] = $result[0]["product_id"];
$data = array_merge($data, $row);
}
fclose($handle);
$result = $client->call($session, 'sales_order_shipment.create', array($argv[1], $data));
} else {
$result = $client->call($session, 'sales_order_shipment.create', $argv[1]);
}
Thank you in advance for any help you can provide.