[-] FO: Cookie are now sharing when your shop is sharing orders from others shop
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16107 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+8
-11
@@ -114,9 +114,15 @@ $cookieLifetime = (time() + (((int)Configuration::get('PS_COOKIE_LIFETIME_BO') >
|
|||||||
if (defined('_PS_ADMIN_DIR_'))
|
if (defined('_PS_ADMIN_DIR_'))
|
||||||
$cookie = new Cookie('psAdmin', '', $cookieLifetime);
|
$cookie = new Cookie('psAdmin', '', $cookieLifetime);
|
||||||
else
|
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 */
|
/* Create employee if in BO, customer else */
|
||||||
if (defined('_PS_ADMIN_DIR_'))
|
if (defined('_PS_ADMIN_DIR_'))
|
||||||
{
|
{
|
||||||
@@ -135,14 +141,6 @@ else
|
|||||||
{
|
{
|
||||||
$customer = new Customer($cookie->id_customer);
|
$customer = new Customer($cookie->id_customer);
|
||||||
$customer->logged = $cookie->logged;
|
$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
|
else
|
||||||
{
|
{
|
||||||
@@ -152,7 +150,6 @@ else
|
|||||||
if (Group::isFeatureActive())
|
if (Group::isFeatureActive())
|
||||||
$customer->id_default_group = Configuration::get('PS_UNIDENTIFIED_GROUP');
|
$customer->id_default_group = Configuration::get('PS_UNIDENTIFIED_GROUP');
|
||||||
}
|
}
|
||||||
|
|
||||||
$customer->id_guest = $cookie->id_guest;
|
$customer->id_guest = $cookie->id_guest;
|
||||||
Context::getContext()->customer = $customer;
|
Context::getContext()->customer = $customer;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user