Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get all stores for admin scope #184

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions magmi/engines/magmi_productimportengine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "*") {
$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"];
Expand Down Expand Up @@ -853,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:
Expand Down