try on a test server first and do a back up. you need to implement a function and call it everytime you check for access: 1)create another field in the mysql database, table ps_category_group: I called it gr_cat_red it is a decimal(10,2) this field would tell the system, the group category reduction (gr_cat_red) of each group and each category. in this field you will need to put the reduction discount i.e. 55.7% for cat 11, group 3 2) in classes/Category.php add this fuction:
public function checkCategoryRed($id_customer,$id_category_default,$id_group)
{
if (!$id_customer)
{
$result = Db::getInstance()->getRow('
SELECT ctg.gr_cat_red AS reduction
FROM '._DB_PREFIX_.'category_group ctg
WHERE ctg.id_category = '.$id_category_default.'
AND ctg.id_group = 1') ;
} else
{
$result = Db::getInstance()->getRow('
SELECT ctg.`gr_cat_red` AS reduction
FROM '._DB_PREFIX_.'category_group ctg
INNER JOIN '._DB_PREFIX_.'customer_group cg on cg.`id_customer` = '.$id_customer.' AND ctg.`id_group` = '.$id_group.'
WHERE ctg.`id_category` = '.$id_category_default );
}
return $result['reduction'];
}
call this fuction anytime you want to check for access.