// Fix #PSCFV-5166

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17906 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-10-22 16:10:49 +00:00
parent 7aab0f297e
commit cd9ed652ca
+3 -3
View File
@@ -484,7 +484,7 @@ class StockAvailableCore extends ObjectModel
$stock_available->id_product_attribute = (int)$id_product_attribute; $stock_available->id_product_attribute = (int)$id_product_attribute;
$stock_available->quantity = (int)$quantity; $stock_available->quantity = (int)$quantity;
$shop_group = new ShopGroup((int)Shop::getContextShopGroupID()); $shop_group = new ShopGroup((int)Shop::getGroupFromShop((int)$id_shop));
// if quantities are shared between shops of the group // if quantities are shared between shops of the group
if ($shop_group->share_stock) if ($shop_group->share_stock)
@@ -494,8 +494,8 @@ class StockAvailableCore extends ObjectModel
} }
else else
{ {
$stock_available->id_shop = $id_shop; $stock_available->id_shop = (int)$id_shop;
$stock_available->id_shop_group = Shop::getGroupFromShop($id_shop); $stock_available->id_shop_group = 0;
} }
$stock_available->add(); $stock_available->add();
} }