Here is the useful code for a purpose : update stock item quantity for a product in magento: $product = Mage::getModel(‘catalog/product’)->load($productId); if ($product){ if (!($stockItem = $product->getStockItem())) { $stockItem = Mage::getModel(‘cataloginventory/stock_item’); $stockItem->assignProduct($product); } $stockItem->setData(‘qty’,intval($qty)) ->setData(‘is_in_stock’, intval($qty) > 0 ? 1 : 0) ->setData(‘manage_stock’, 1) ->setData(‘use_config_manage_stock’, 0) ->save(); }
SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range in ‘(`DB`.`tag_summary`.`products` – 1)’ Magento Version 1.9.0.1 Project Fix: I recently had to resolve this issue for a customer, and since it was quite easy to fix, I figured I’d share with all you developer and do…