// notice id_shop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7898 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+5
-5
@@ -188,13 +188,17 @@ class ShopCore extends ObjectModel
|
|||||||
AND s.active = 1
|
AND s.active = 1
|
||||||
AND s.deleted = 0
|
AND s.deleted = 0
|
||||||
ORDER BY LENGTH(uri) DESC';
|
ORDER BY LENGTH(uri) DESC';
|
||||||
|
|
||||||
|
$id_shop = '';
|
||||||
if ($results = Db::getInstance()->executeS($sql))
|
if ($results = Db::getInstance()->executeS($sql))
|
||||||
foreach ($results as $row)
|
foreach ($results as $row)
|
||||||
|
{
|
||||||
if (preg_match('#^'.preg_quote($row['uri'], '#').'#', $_SERVER['REQUEST_URI']))
|
if (preg_match('#^'.preg_quote($row['uri'], '#').'#', $_SERVER['REQUEST_URI']))
|
||||||
{
|
{
|
||||||
$id_shop = $row['id_shop'];
|
$id_shop = $row['id_shop'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$id_shop)
|
if (!$id_shop)
|
||||||
die('Shop not found ... redirect me please !');
|
die('Shop not found ... redirect me please !');
|
||||||
@@ -365,8 +369,6 @@ class ShopCore extends ObjectModel
|
|||||||
self::$shops[$row['id_group_shop']] = array(
|
self::$shops[$row['id_group_shop']] = array(
|
||||||
'id' => $row['id_group_shop'],
|
'id' => $row['id_group_shop'],
|
||||||
'name' => $row['group_name'],
|
'name' => $row['group_name'],
|
||||||
'share_customer' => $row['share_customer'],
|
|
||||||
'share_order' => $row['share_order'],
|
|
||||||
'share_stock' => $row['share_stock'],
|
'share_stock' => $row['share_stock'],
|
||||||
'shops' => array(),
|
'shops' => array(),
|
||||||
);
|
);
|
||||||
@@ -476,9 +478,6 @@ class ShopCore extends ObjectModel
|
|||||||
die('Wrong argument ($type) in Shop::getSharedShops() method');
|
die('Wrong argument ($type) in Shop::getSharedShops() method');
|
||||||
|
|
||||||
Shop::cacheShops();
|
Shop::cacheShops();
|
||||||
foreach (self::$shops as $groupData)
|
|
||||||
if (array_key_exists($shopID, $groupData['shops']) && $groupData[$type])
|
|
||||||
return array_keys($groupData['shops']);
|
|
||||||
return array($shopID);
|
return array($shopID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -743,3 +742,4 @@ class ShopCore extends ObjectModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user