Merge pull request #134 from PrestaEdit/patch-2
[-] FO: need id_product_attribute to know quantity
This commit is contained in:
+2
-1
@@ -2439,12 +2439,13 @@ class ProductCore extends ObjectModel
|
||||
if ((int)$id_cart)
|
||||
{
|
||||
$condition = '';
|
||||
$cache_name = (int)$id_cart.'_'.(int)$id_product;
|
||||
$cache_name = (int)$id_cart.'_'.(int)$id_product.'_'.(int)$id_product_attribute;
|
||||
if (!isset(self::$_cart_quantity[$cache_name]) || self::$_cart_quantity[$cache_name] != (int)$quantity)
|
||||
self::$_cart_quantity[$cache_name] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT SUM(`quantity`)
|
||||
FROM `'._DB_PREFIX_.'cart_product`
|
||||
WHERE `id_product` = '.(int)$id_product.'
|
||||
AND `id_product_attribute` = '.(int)$id_product_attribute.'
|
||||
AND `id_cart` = '.(int)$id_cart);
|
||||
$cart_quantity = self::$_cart_quantity[$cache_name];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user