// Fix product visibility on Product::getAccessories and ProductSale::getBestSales #PSCFV-9760
This commit is contained in:
@@ -3160,8 +3160,9 @@ class ProductCore extends ObjectModel
|
||||
LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (p.`id_manufacturer`= m.`id_manufacturer`)
|
||||
'.Product::sqlStock('p', 0).'
|
||||
WHERE `id_product_1` = '.(int)$this->id.
|
||||
($active ? ' AND product_shop.`active` = 1' : '').'
|
||||
($active ? ' AND product_shop.`active` = 1 AND product_shop.`visibility` != \'none\'' : '').'
|
||||
GROUP BY product_shop.id_product';
|
||||
|
||||
if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql))
|
||||
return false;
|
||||
foreach ($result as &$row)
|
||||
|
||||
@@ -103,7 +103,7 @@ class ProductSaleCore
|
||||
LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`)
|
||||
'.Product::sqlStock('p').'
|
||||
WHERE product_shop.`active` = 1
|
||||
AND p.`visibility` != \'none\'
|
||||
AND product_shop.`visibility` != \'none\'
|
||||
AND p.`id_product` IN (
|
||||
SELECT cp.`id_product`
|
||||
FROM `'._DB_PREFIX_.'category_group` cg
|
||||
@@ -156,7 +156,7 @@ class ProductSaleCore
|
||||
ON cl.`id_category` = product_shop.`id_category_default`
|
||||
AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').'
|
||||
WHERE product_shop.`active` = 1
|
||||
AND p.`visibility` != \'none\'
|
||||
AND product_shop.`visibility` != \'none\'
|
||||
AND p.`id_product` IN (
|
||||
SELECT cp.`id_product`
|
||||
FROM `'._DB_PREFIX_.'category_group` cg
|
||||
|
||||
Reference in New Issue
Block a user