The Problem:
Twitch Restrict Categories by Customer or Group
Advanced Search Plus 2.0
Twitch Restrict hides categories, Advanced Search Plus searches categories...
The Fix:
In order to hide restricted categories when these two modules are installed together, you need to update:
includes/modules/YOUR_TEMPLATE/advanced_search_categories.php
line 47 - 48
from this:
$from_str_cat = " from " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_CATEGORIES . " c ";
$where_str_cat = " where c.categories_status <> 0 AND cd.categories_id = c.categories_id and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'"; //2011-03-24 Included c.categories_status <> 0 AND condition to avoid displaying Disabled categories
to this:
$from_str_cat = " from " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_CATEGORIES_CUSTOMERS . " ccu, " . TABLE_CATEGORIES . " c ";
$where_str_cat = " where c.categories_status <> 0
AND cd.categories_id = c.categories_id
AND cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
AND c.categories_id = ccu.categories_id
AND (ccu.customers_cat_group = '" . (int)$_SESSION['customers_cat_group'] . "' OR ccu.customers_cat_group = '0' )"; //2011-03-24 Included c.categories_status <> 0 AND condition to avoid displaying Disabled categories
Now the search return will hide restricted categories.
Note: This fix only applies when you have both modules installed.


Reply With Quote
