From 70a25fa7c2f171a02df07497b196ae83bca1961e Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 26 Jan 2015 14:45:11 +0100 Subject: [PATCH 1/2] Get all stores for admin scope --- magmi/engines/magmi_productimportengine.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/magmi/engines/magmi_productimportengine.php b/magmi/engines/magmi_productimportengine.php index 719fcee4..29cb2dca 100755 --- a/magmi/engines/magmi_productimportengine.php +++ b/magmi/engines/magmi_productimportengine.php @@ -168,11 +168,18 @@ public function getStoreIdsForStoreScope($scodes) if (!isset($this->_sid_sscope[$scodes])) { $this->_sid_sscope[$scodes] = array(); - $scarr = csl2arr($scodes); - $qcolstr = $this->arr2values($scarr); $cs = $this->tablename("core_store"); - $sql = "SELECT csmain.store_id from $cs as csmain WHERE csmain.code IN ($qcolstr)"; - $sidrows = $this->selectAll($sql, $scarr); + + if ($scodes == 'admin') { + $sql = "SELECT csmain.store_id from $cs as csmain"; + $sidrows = $this->selectAll($sql, $scarr); + } else { + $scarr = csl2arr($scodes); + $qcolstr = $this->arr2values($scarr); + $sql = "SELECT csmain.store_id from $cs as csmain WHERE csmain.code IN ($qcolstr)"; + $sidrows = $this->selectAll($sql, $scarr); + } + foreach ($sidrows as $sidrow) { $this->_sid_sscope[$scodes][] = $sidrow["store_id"]; From 6a60b2c3df97a3b1977ad8589d2870def4231e61 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 26 Jan 2015 14:50:56 +0100 Subject: [PATCH 2/2] Differentiate between store and global --- magmi/engines/magmi_productimportengine.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/magmi/engines/magmi_productimportengine.php b/magmi/engines/magmi_productimportengine.php index 29cb2dca..98599188 100755 --- a/magmi/engines/magmi_productimportengine.php +++ b/magmi/engines/magmi_productimportengine.php @@ -170,7 +170,7 @@ public function getStoreIdsForStoreScope($scodes) $this->_sid_sscope[$scodes] = array(); $cs = $this->tablename("core_store"); - if ($scodes == 'admin') { + if ($scodes == "*") { $sql = "SELECT csmain.store_id from $cs as csmain"; $sidrows = $this->selectAll($sql, $scarr); } else { @@ -860,7 +860,7 @@ public function getItemStoreIds($item, $scope = 0) { // global scope case 1: - $bstore_ids = $this->getStoreIdsForStoreScope("admin"); + $bstore_ids = $this->getStoreIdsForStoreScope("*"); break; // store scope case 0: