// improve config.inc.php code, add in cookie id_cart if there's a current order in a different shop that shares orders
This commit is contained in:
1 parent
51704646e2
commit
c97b48b394
1 file changed
+4
-8
@@ -141,14 +141,10 @@ else
|
|||||||
|
|
||||||
if (!isset($cookie->id_cart))
|
if (!isset($cookie->id_cart))
|
||||||
{
|
{
|
||||||
$groupShop = new GroupShop(Context::getContext()->shop->id_group_shop);
|
$shops_share = Context::getContext()->shop->getListOfID(Shop::SHARE_ORDER);
|
||||||
foreach (Shop::getSharedShops(Context::getContext()->shop->getID(), Shop::SHARE_ORDER) as $k => $v)
|
$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)
|
||||||
$cart = new Cart();
|
$cookie->id_cart = $id_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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in new issue
Block a user