// notice id_shop

This commit is contained in:
fBrignoli
2011-08-05 08:13:04 +00:00
parent c10fb24e31
commit e589a52a52
+5 -5
View File
@@ -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
} }
} }
} }