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

Magento API:  product.update with multiple SKUs at a time.  Possible? 
 
hurstc
Jr. Member
 
Total Posts:  4
Joined:  2009-09-08
 

I am updating around 2,000 products at a time via the product.update API. Currently, it looks like this:

foreach($products as $product)
{
    $updated 
= array($product->sku,  array('pill_size' => $product->pill_size));
    
// Update pill size for this product
    
$proxy->call($sessionId'product.update'$updated);

}

Currently, this takes FOREVER to run.  I’m wondering if its possible to send multiple SKU => data in a single product.update call-- maybe something like…

$updated = array(    
              array(    
'SKU1'
                       
'SKU2'
                        
'SKU3'
                
),    
              array(    array(
'pill_size' => $pill_size1), 
                        array(
'pill_size' => $pill_size2), 
                        array(
'pill_size' => $pill_size3)
                )
            );



// Update pill size for products SKU1, SKU2, SKU3
$proxy->call($sessionId'product.update'$updated);

Is anything like this possible? Would this method even save any script processing time?

 
Magento Community Magento Community
Magento Community
Magento Community
 
hurstc
Jr. Member
 
Total Posts:  4
Joined:  2009-09-08
 

I just found the multiCall method, so I’m gonna give it a try.

$block_call = array(
                                array(
'product.update', array('sku1', array('pill_size' => 'pillsize1'))),
                                array(
'product.update', array('sku2', array('pill_size' => 'pillsize2'))),
                                .......
                                array(
'product.update', array('sku100', array('pill_size' => 'pillsize100')))
                            );    
$proxy->multiCall($sessionId$block_call);

Does anybody know the limitations of multiCall?  How many calls can be sent at once? How are errors returned?

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