// improve config.inc.php code, add in cookie id_cart if there's a current order in a different shop that shares orders
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11355 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -141,14 +141,10 @@ else
|
||||
|
||||
if (!isset($cookie->id_cart))
|
||||
{
|
||||
$groupShop = new GroupShop(Context::getContext()->shop->id_group_shop);
|
||||
foreach (Shop::getSharedShops(Context::getContext()->shop->getID(), Shop::SHARE_ORDER) as $k => $v)
|
||||
{
|
||||
$cart = new Cart();
|
||||
$id_cart = Db::getInstance()->getValue('SELECT `id_cart` FROM `'._DB_PREFIX_.'cart` WHERE `id_customer` = "'.(int)$customer->id.'" ORDER BY `id_cart` DESC');
|
||||
if (Db::getInstance()->getValue('SELECT `quantity` FROM `'._DB_PREFIX_.'cart_product` WHERE `id_cart` = "'.(int)$id_cart.'"') > 0)
|
||||
$cookie->id_cart = $id_cart;
|
||||
}
|
||||
$shops_share = Context::getContext()->shop->getListOfID(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
|
||||
|
||||
Reference in New Issue
Block a user