So, I'm using Magmi to scan through a database and update inventory for a multi-warehouse Magento setup. This is the pertinent code I'm using:
foreach ($store as $key => $sqty) {
$sku = odbc_result($rs4, 'sku');
$qty = odbc_result($rs4, $sqty);
$updateItem=array("sku"=>$sku, "stock_id"=>$key, "qty"=>$qty);
$dp->ingest($updateItem);
}
The $store array has 7 entries that indicate the $key and $qty. It runs all 7 times, but only updates the first entry.
I've narrowed it down and it looks like the issue is in the productimport_datapump.php file on line 62:
$item = array_merge($this->_defaultvalues, $item);
$diff = array_diff(array_keys($item), $this->_importcolumns);
if (count($diff) > 0) {
Since the column names are the same, it doesn't import anything past the first entry. Any idea how I can fix this? I've tried brute forcing by restarting the datapump session and starting a new instance on every foreach, but that generates some weird filename errors and obviously isn't best practice.
Thanks!