From 80fb4e7b0e1628f171f858250405077f44336b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 24 Jan 2013 17:29:53 +0100 Subject: [PATCH 1/2] [-] MO: Fix #PSCFV-7416 product name in blocklayered listing with multishop --- modules/blocklayered/blocklayered.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/blocklayered/blocklayered.php b/modules/blocklayered/blocklayered.php index 52bd7e026..94e11ce26 100644 --- a/modules/blocklayered/blocklayered.php +++ b/modules/blocklayered/blocklayered.php @@ -2525,7 +2525,7 @@ class BlockLayered extends Module LEFT JOIN '._DB_PREFIX_.'category c ON (c.id_category = cp.id_category) LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product` '.$join.' - LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product) + LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').') LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1) LEFT JOIN '._DB_PREFIX_.'image_lang il ON (i.id_image = il.id_image AND il.id_lang = '.(int)($cookie->id_lang).') LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer) From 24273960cc341e4745d65bd999daad91becdd016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 24 Jan 2013 18:25:42 +0100 Subject: [PATCH 2/2] [-] FO: Fix #PSCFV-7322 Product::getProductProperties quantity cache --- classes/Product.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/classes/Product.php b/classes/Product.php index 7a90ea8ab..31b781f9f 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -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'), @@ -3722,14 +3722,21 @@ class ProductCore extends ObjectModel $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']);