Skip to content

Commit

Permalink
CO: Fixed hardcoded group id in getNewProducts
Browse files Browse the repository at this point in the history
Use configuration PS_UNIDENTIFIED_GROUP for unidentified customers group instead of hardcoded value
  • Loading branch information
robin-rozo authored and Robin committed Sep 28, 2016
1 parent bd6ae58 commit c06a9db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/Product.php
Expand Up @@ -2283,7 +2283,7 @@ public static function getNewProducts($id_lang, $page_number = 0, $nb_products =
if (Group::isFeatureActive()) {
$groups = FrontController::getCurrentCustomerGroups();
$sql_groups = ' AND EXISTS(SELECT 1 FROM `'._DB_PREFIX_.'category_product` cp
JOIN `'._DB_PREFIX_.'category_group` cg ON (cp.id_category = cg.id_category AND cg.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1').')
JOIN `'._DB_PREFIX_.'category_group` cg ON (cp.id_category = cg.id_category AND cg.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= '.(int)Configuration::get('PS_UNIDENTIFIED_GROUP')).')
WHERE cp.`id_product` = p.`id_product`)';
}

Expand Down

0 comments on commit c06a9db

Please sign in to comment.