// Fix many bug with stock
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16108 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -409,7 +409,7 @@ class StockAvailableCore extends ObjectModel
|
||||
$context = Context::getContext();
|
||||
|
||||
// if there is no $id_shop, gets the context one
|
||||
if ($id_shop === null)
|
||||
if ($id_shop === null && Shop::getContext() != Shop::CONTEXT_GROUP)
|
||||
$id_shop = (int)$context->shop->id;
|
||||
|
||||
$depends_on_stock = StockAvailable::dependsOnStock($id_product);
|
||||
@@ -574,8 +574,13 @@ class StockAvailableCore extends ObjectModel
|
||||
// get shop group too
|
||||
if ($id_shop === null)
|
||||
{
|
||||
$id_shop = $context->shop->id;
|
||||
$shop_group = $context->shop->getGroup();
|
||||
if (Shop::getContext() == Shop::CONTEXT_GROUP)
|
||||
$shop_group = Shop::getContextShopGroup();
|
||||
else
|
||||
{
|
||||
$shop_group = $context->shop->getGroup();
|
||||
$id_shop = $context->shop->id;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user