Skip to content

Commit

Permalink
[-] FO: Fix #PSCFV-7322 Product::getProductProperties quantity cache
Browse files Browse the repository at this point in the history
  • Loading branch information
rGaillard committed Jan 24, 2013
1 parent 80fb4e7 commit 2427396
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions classes/Product.php
Expand Up @@ -244,7 +244,7 @@ class ProductCore extends ObjectModel
'multilang' => true,
'multilang_shop' => true,
'fields' => array(
/* Classic fields */
// Classic fields
'id_shop_default' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
Expand Down Expand Up @@ -3722,14 +3722,21 @@ public static function getProductProperties($id_lang, $row, Context $context = n

$row['specific_prices'] = $specific_prices;

$row['quantity'] = Product::getQuantity(
(int)$row['id_product'],
0,
isset($row['cache_is_pack']) ? $row['cache_is_pack'] : null
);

if ($row['id_product_attribute'])
$row['quantity_all_versions'] = Product::getQuantity(
{
$row['quantity_all_versions'] = $row['quantity'];
$row['quantity'] = Product::getQuantity(
(int)$row['id_product'],
0,
isset($row['cache_is_pack']) ? $row['cache_is_pack'] : null
$row['id_product_attribute'],
isset($row['cache_is_pack']) ? $row['cache_is_pack'] : null
);
else
$row['quantity'] = Product::getQuantity((int)$row['id_product']);
}

$row['id_image'] = Product::defineProductImage($row, $id_lang);
$row['features'] = Product::getFrontFeaturesStatic((int)$id_lang, $row['id_product']);
Expand Down

0 comments on commit 2427396

Please sign in to comment.