[+] BO : added a new option for the products : do they appear in the catalog, in the search, both or neither

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13638 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger
2012-02-27 15:55:40 +00:00
parent dcc8c95de7
commit f6b91055d5
15 changed files with 134 additions and 30 deletions
+6 -3
View File
@@ -214,6 +214,7 @@ class SearchCore
'.Shop::addSqlAssociation('product', 'p', false).'
WHERE c.`active` = 1
AND p.`active` = 1
AND p.`visibility` IN ("both", "search")
AND indexed = 1
AND cg.`id_group` '.(!$id_customer ? '= 1' : 'IN (
SELECT id_group FROM '._DB_PREFIX_.'customer_group
@@ -381,7 +382,8 @@ class SearchCore
LEFT JOIN '._DB_PREFIX_.'manufacturer m
ON m.id_manufacturer = p.id_manufacturer
WHERE p.indexed = 0
'.($id_product ? 'AND p.id_product = '.(int)$id_product : '').'
AND p.visibility IN ("both", "search")
'.($id_product ? 'AND p.id_product = '.(int)$id_product : '').'
LIMIT '.(int)$limit
);
}
@@ -401,11 +403,12 @@ class SearchCore
}
else
{
// Do it even if you already know the product id in order to be sure that it exists
// Do it even if you already know the product id in order to be sure that it exists and it needs to be indexed
$products = $db->executeS('
SELECT id_product
FROM '._DB_PREFIX_.'product
WHERE '.($id_product ? 'id_product = '.(int)$id_product : 'indexed = 0')
WHERE visibility IN ("both", "search")
AND '.($id_product ? 'id_product = '.(int)$id_product : 'indexed = 0')
);
$ids = array();