diff --git a/magmi/engines/magmi_productimportengine.php b/magmi/engines/magmi_productimportengine.php index 714b234c..192fe26f 100755 --- a/magmi/engines/magmi_productimportengine.php +++ b/magmi/engines/magmi_productimportengine.php @@ -984,7 +984,7 @@ public function createAttributes($pid, &$item, $attmap, $isnew, $itemids) } else { // if handled value is a "DELETE" or a NULL , which will also be removed if ($ovalue == '__MAGMI_DELETE__') { - $deletes[] = $attid; + $deletes[$store_id][] = $attid; // do not handle value in insert $ovalue = null; } @@ -1033,10 +1033,12 @@ public function createAttributes($pid, &$item, $attmap, $isnew, $itemids) //if we have values to delete if (!empty($deletes)) { - $sidlist = implode(",", $store_ids); - $attidlist = implode(",", $deletes); - $sql = "DELETE FROM $cpet WHERE entity_type_id=? AND attribute_id IN ($attidlist) AND store_id IN ($sidlist) AND entity_id=?"; - $this->delete($sql, array($this->getProductEntityType(), $pid)); + foreach ($deletes as $store_id => $to_delete) { + $sidlist = $store_id; + $attidlist = implode(",", $to_delete); + $sql = "DELETE FROM $cpet WHERE entity_type_id=? AND attribute_id IN ($attidlist) AND store_id IN ($sidlist) AND entity_id=?"; + $this->delete($sql, array($this->getProductEntityType(),$pid)); + } } //if no values inserted or deleted on a new item, we have a problem if (empty($deletes) && empty($inserts) && $isnew) { diff --git a/magmi/plugins/5b5/general/attributesetimport/attributesetimport.php b/magmi/plugins/5b5/general/attributesetimport/attributesetimport.php index 740f6abb..a317680d 100644 --- a/magmi/plugins/5b5/general/attributesetimport/attributesetimport.php +++ b/magmi/plugins/5b5/general/attributesetimport/attributesetimport.php @@ -238,7 +238,7 @@ private function prepareCSV($prefix) $url = $this->getParam($prefix.":remoteurl", ""); $outname = $this->getRemoteFile($prefix, $url); $this->setParam($prefix.":filename", $outname); - $csvreader->initialize($this->_params); + $csvreader->initialize($this->_params, $prefix); } $csvreader->checkCSV();