I have 4 stores with different stores with some similar and some different products.
I want different inventory for all stores, I tried to add the inventory of stores it changes Globally, I'm using the below code.
$sku='123asd';
$qty=12;
$exitProduct = Mage::getResourceSingleton('catalog/product')->getIdBySku((string)$sku);
if ($exitProduct) {
$product = Mage::getModel('catalog/product')->load($exitProduct);
$product->setStoreId(2)->setPrice($xmlDatas['preco'])->save();
$productId = $product->getId();
$stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);
$stockItem->setData('manage_stock', 1);
$stockItem->setData('qty', (integer) $qty]);
$stockItem->save();
} else {
continue;
}
How can I set different Qty for different stores?