[-] FO : #PSCFV-1792 - Fix bug with attribute check_access of the method Category::getProducts()

This commit is contained in:
mDeflotte committed 2012-05-11 12:10:22 +00:00
1 parent ee40dcef45
commit 7a2490239a
1 file changed
+2 -2
+2 -2
View File
@@ -585,7 +585,7 @@ class CategoryCore extends ObjectModel
{ {
if (!$context) if (!$context)
$context = Context::getContext(); $context = Context::getContext();
if (!$check_access || !$this->checkAccess($context->customer->id)) if ($check_access && !$this->checkAccess($context->customer->id))
return false; return false;
$front = true; $front = true;
@@ -682,7 +682,7 @@ class CategoryCore extends ObjectModel
.($front ? ' AND product_shop.`visibility` IN ("both", "catalog")' : '') .($front ? ' AND product_shop.`visibility` IN ("both", "catalog")' : '')
.($id_supplier ? ' AND p.id_supplier = '.(int)$id_supplier : ''); .($id_supplier ? ' AND p.id_supplier = '.(int)$id_supplier : '');
$sql .= 'GROUP BY p.`id_product`'; $sql .= ' GROUP BY p.`id_product`';
if ($random === true) if ($random === true)
{ {
$sql .= ' ORDER BY RAND()'; $sql .= ' ORDER BY RAND()';