cancel
Showing results for 
Search instead for 
Did you mean: 

Create Partial Shipment

Create Partial Shipment

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.

 

 

1 REPLY 1

Re: Create Partial Shipment

You're going to need to post your entire file into something like a GIST on github. Then output the paramter values that you're sending the function in question and post those into a different GIST for me. If anything is returned by your function, dump the data and post it into another GIST.

 

I need to understand everything that's happening in order to help you out.

Enterprise Architect

800-207-1221
https://merchantprotocol.com

Magento Extension Developers