Merge branch 'ticket_9890' into develop
This commit is contained in:
commit
20640ba5ae
@ -159,7 +159,7 @@ class Product extends ProductCore
|
||||
|
||||
if ($row['id_product_attribute'])
|
||||
{
|
||||
$row['quantity_all_versions'] = $row['quantity'];
|
||||
$row['quantity_all_versions'] = Product::getTotalAttributeQuantity((int)$row['id_product']);
|
||||
$row['quantity'] = Product::getQuantity((int)$row['id_product'], $row['id_product_attribute'], isset($row['cache_is_pack']) ? $row['cache_is_pack'] : NULL);
|
||||
}
|
||||
$row['id_image'] = Product::defineProductImage($row, $id_lang);
|
||||
@ -285,4 +285,15 @@ class Product extends ProductCore
|
||||
}
|
||||
return !$return ? false : $combinationImages;
|
||||
}
|
||||
|
||||
public static function getTotalAttributeQuantity($id_product)
|
||||
{
|
||||
$quantity = Db::getInstance()->getValue('
|
||||
SELECT SUM(`quantity`)
|
||||
FROM `'._DB_PREFIX_.'product_attribute`
|
||||
WHERE `id_product` = '.(int)($id_product)
|
||||
);
|
||||
|
||||
return $quantity;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user