[-] FO-BO: #PSFV-95 : deleted some treatments for avoid code repeated

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9187 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
aNiassy
2011-10-10 13:19:40 +00:00
parent 3fdb9d9eec
commit 31815febc5
-37
View File
@@ -585,43 +585,6 @@ class ShopCore extends ObjectModel
else if ($type == 'group')
return $shop_group_id;
return array($shop_id, $shop_group_id);
if (!$executed)
{
$context = Context::getContext();
if (defined('_PS_ADMIN_DIR_'))
{
// While cookie is not instancied in admin, we wait ...
if (!isset($context->cookie))
return ($type == 'shop' || $type == 'group') ? '' : array('', '');
// Parse shopContext cookie value (E.g. s-2, g-4)
$split = explode('-', $context->cookie->shopContext);
if (count($split) == 2)
{
if ($split[0] == 's')
$shop_id = (int)$split[1];
else if ($split[0] == 'g')
$shop_group_id = (int)$split[1];
if ($shop_id && !$shop_group_id)
$shop_group_id = Shop::getGroupFromShop($shop_id);
}
}
else
{
$shop_id = (int)$context->shop->getID();
$shop_group_id = (int)$context->shop->id_group_shop;
}
$executed = true;
}
if ($type == 'shop')
return $shop_id;
else if ($type == 'group')
return $shop_group_id;
return array($shop_id, $shop_group_id);
}
/**