0

I want to add quantities to all of my 780 products using custom script. Is there anyway to do it from admin. I had tried a way to export products first then add quantities in csv file, remove all products from store, then again import products, its working fine but issue with product images.

Can anyone tell me the way to inject database table directly from script to update quantities.

Thanks in advance
Sanjay

sanjay kumar
  • 69
  • 1
  • 2
  • 9

3 Answers3

0

Take a look at cataloginventory_stock_status. I think you can update your stock there. :)

boti
  • 677
  • 5
  • 12
0

No need to hanle db.

$product = //initialize product
$product->setStockData(
     array(
        'is_in_stock' => 1,
        'qty' => $qty
     )
);
$product->save();
Jevgeni Smirnov
  • 3,787
  • 5
  • 33
  • 50
0

If you want to have mass update for Qtys using raw sql (very fast enough for millions of products), then you can try the following article:
http://www.blog.magepsycho.com/updating-product-qty-in-magento-in-an-easier-faster-way/

Hope this helps. Thanks

MagePsycho
  • 1,944
  • 2
  • 29
  • 60