// Cookies subdomain & bug fix on stocks
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16110 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -343,15 +343,17 @@ class StockAvailableCore extends ObjectModel
|
||||
if ($this->id_product_attribute == 0)
|
||||
return true;
|
||||
|
||||
$id_shop = (Shop::getContext() != Shop::CONTEXT_GROUP ? $this->id_shop : null);
|
||||
|
||||
$total_quantity = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT SUM(quantity) as quantity
|
||||
FROM '._DB_PREFIX_.'stock_available
|
||||
WHERE id_product = '.(int)$this->id_product.'
|
||||
AND id_product_attribute <> 0 '.
|
||||
StockAvailable::addSqlShopRestriction(null, $this->id_shop)
|
||||
StockAvailable::addSqlShopRestriction(null, $id_shop)
|
||||
);
|
||||
|
||||
$this->setQuantity($this->id_product, 0, $total_quantity, $this->id_shop);
|
||||
$this->setQuantity($this->id_product, 0, $total_quantity, $id_shop);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user