Brands Filter Custom Display

Presently i am using cscart version 3.0.3



→ Currently in Brand filter section on the left side of the page we are getting all brands list.



→ But i need to modify code so that it should get only brands of the products that are searched.



The query for getting brands list is being written in fn_get_filters_products_count() function. and the variable is $ranges_counts





Now i need to add condition to the query with product ids of serched result products like ex :



$where .= " AND ?:products.product_id IN('1050924','1083996')";





so how can i get searched product information in fn_get_filters_products_count() function?