diff --git a/config/config.inc.php b/config/config.inc.php index 90e39c33f..92aa1bbfa 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -114,9 +114,15 @@ $cookieLifetime = (time() + (((int)Configuration::get('PS_COOKIE_LIFETIME_BO') > if (defined('_PS_ADMIN_DIR_')) $cookie = new Cookie('psAdmin', '', $cookieLifetime); else - $cookie = new Cookie('ps'.Context::getContext()->shop->id, '', $cookieLifetime); -Context::getContext()->cookie = $cookie; +{ + if (Context::getContext()->shop->getGroup()->share_order) + $cookie = new Cookie('ps-sg'.Context::getContext()->shop->getGroup()->id, '', $cookieLifetime); + else + $cookie = new Cookie('ps-s'.Context::getContext()->shop->id, '', $cookieLifetime); + +} +Context::getContext()->cookie = $cookie; /* Create employee if in BO, customer else */ if (defined('_PS_ADMIN_DIR_')) { @@ -135,14 +141,6 @@ else { $customer = new Customer($cookie->id_customer); $customer->logged = $cookie->logged; - - if (!isset($cookie->id_cart)) - { - $shops_share = Shop::getContextListShopID(Shop::SHARE_ORDER); - $id_cart = Db::getInstance()->getValue('SELECT `id_cart` FROM `'._DB_PREFIX_.'cart` WHERE `id_customer` = "'.(int)$customer->id.'" AND `id_shop` IN ("'.implode('","', $shops_share).'") ORDER BY `id_cart` DESC'); - if ($id_cart != false) - $cookie->id_cart = $id_cart; - } } else { @@ -152,7 +150,6 @@ else if (Group::isFeatureActive()) $customer->id_default_group = Configuration::get('PS_UNIDENTIFIED_GROUP'); } - $customer->id_guest = $cookie->id_guest; Context::getContext()->customer = $customer; }