// Fix join between product_attribute and product_attribute_shop on getproducts methods

This commit is contained in:
rMalie
2012-04-17 16:10:51 +00:00
parent 652d60525b
commit 60b281c4e3
4 changed files with 7 additions and 8 deletions
+1 -2
View File
@@ -337,7 +337,7 @@ class ManufacturerCore extends ObjectModel
'.Shop::addSqlAssociation('product', 'p').'
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
ON (p.`id_product` = pa.`id_product`)
'.Shop::addSqlAssociation('product_attribute', 'pa').'
'.Shop::addSqlAssociation('product_attribute', 'pa', false, 'product_attribute_shop.default_on = 1').'
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').')
LEFT JOIN `'._DB_PREFIX_.'image` i
@@ -359,7 +359,6 @@ class ManufacturerCore extends ObjectModel
WHERE p.`id_manufacturer` = '.(int)$id_manufacturer.'
'.($active ? ' AND product_shop.`active` = 1' : '').'
'.($front ? ' AND product_shop.`visibility` IN ("both", "catalog")' : '').'
AND product_attribute_shop.`default_on` = 1
AND p.`id_product` IN (
SELECT cp.`id_product`
FROM `'._DB_PREFIX_.'category_group` cg