SELECT store_filter_groups.name AS group_name, store_filters.*, COUNT(DISTINCT store_products.id) AS counter FROM store_products INNER JOIN store_products2categories ON store_products2categories.productid = store_products.id INNER JOIN store_categories ON store_categories.id = store_products2categories.categoryid AND store_categories.id = '6770' INNER JOIN store_product_types ON store_product_types.id = store_products.typeid INNER JOIN store_product_types2customer_types ON store_product_types2customer_types.producttypeid = store_product_types.id INNER JOIN customer_types ON customer_types.id = store_product_types2customer_types.customertypeid INNER JOIN store_warehouses ON store_warehouses.id = store_products.warehouseid INNER JOIN store_products2filters ON store_products2filters.productid = store_products.id INNER JOIN store_filters ON store_filters.id = store_products2filters.filterid INNER JOIN store_filter_groups ON store_filter_groups.id = store_filters.groupid WHERE ( store_filters.code = 'RC' OR store_filters.code = 'R13' OR store_filters.code = 'P38' OR store_filters.code = 'R2' OR store_filters.code = 'R10' OR store_filters.code = 'RS' OR store_filters.code = 'RS10' OR store_filters.code = 'RS14' OR store_filters.code = 'RRV' OR store_filters.code = 'EV' ) AND store_products.active = '1' AND store_products.approved = '1' AND store_products.totallyhidden = '0' AND customer_types.id = '1' GROUP BY store_filters.id ORDER BY store_filter_groups.sort_order ASC, store_filters.sort_order ASC