sorry, I forgot to include that, here's the complete code that goes in the freeoptions.php file
Just enter your top category ids in $top_cat_ids = array('1','2','3');
PHP Code:
$top_cat_ids = array('1','2','3');
$all_cats_exclude = array();
foreach($top_cat_ids as $key => $top_id_value){
$subcat_results = getSubcategories($top_id_value, true);
foreach($subcat_results as $key => $ind_cat_id_value){
$all_cats_exclude[] = $ind_cat_id_value;
}
}
if (!IS_ADMIN_FLAG) {
global $cart;
foreach($all_cats_exclude as $key => $cat_id_value){
$chk_exclude_categories += $_SESSION['cart']->in_cart_check('master_categories_id',$cat_id_value);
}
if ($chk_exclude_categories > 0) {
$this->enabled = false;
}
}
Hope this helps someone, I saw many posts asking how to get all the subcategories by entering the top level category, but I could find any available solution.
Bookmarks