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

Mass product_stock.update API call takes too long. 
 
MathieuF
Sr. Member
 
Total Posts:  141
Joined:  2009-03-12
Montreal, Canada
 

I’m running a shop and I want everything to be in sync with the website. Everytime I do a transaction in store, it updates the inventory on my website.

Thing is, if there is only one item, it’s fast. When I get a 30 items long invoice, it takes around a minute to process.

For each items, I do an API call as follow:

$proxy->call($sessionId, ‘product_stock.update’, array($sku, array(’qty’=>$new_qty, ‘is_in_stock’=>$instock)));

Is there a way to do 1 API call with all of my skus ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Orange Bear
Jr. Member
 
Total Posts:  17
Joined:  2009-06-05
 

http://www.magentocommerce.com/boards/viewthread/32491/

Do it in sql if you are just changing qty

 
Magento Community Magento Community
Magento Community
Magento Community
 
MathieuF
Sr. Member
 
Total Posts:  141
Joined:  2009-03-12
Montreal, Canada
 

Orange Bear: my host is not opening mysql to the outside, for security reasons. Since I’m not really against this policy, I have to use the API.

Shouldn’t an API call be quick ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Orange Bear
Jr. Member
 
Total Posts:  17
Joined:  2009-06-05
 

The sql route takes a bit of work, but the results are instant. It is worthwhile. Your mysql/php script can run on your server connecting to localhost.

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