[-] FO: need id_product_attribute to know quantity

This commit is contained in:
PrestaEdit
2013-01-02 11:04:57 +01:00
parent a4eb2cc7a9
commit 1c24fe85c1
+2 -1
View File
@@ -2421,12 +2421,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];
}