1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND p.products_exclude_from_search = '0' GROUP BY p.products_id ORDER BY r' at line 16

SELECT DISTINCT p.products_id, p.products_barcode, p.products_date_added, p.products_image, p.products_model, p.products_price, p.products_type, p.products_tax_class_id, p.products_price_on_app, pd.products_name, pd.products_description,IF(s.status, s.specials_new_products_price, NULL) AS specials_new_products_price, ( ( p.products_price - s.specials_new_products_price ) / p.products_price ) AS products_discount, IF(s.status, s.specials_new_products_price, p.products_price) AS final_price , SUM(tr.tax_rate) AS tax_rate FROM products p LEFT JOIN specials s ON p.products_id = s.products_id LEFT JOIN tax_rates tr ON p.products_tax_class_id = tr.tax_class_id LEFT JOIN zones_to_geo_zones gz ON tr.tax_zone_id = gz.geo_zone_id AND (gz.zone_country_id IS null OR gz.zone_country_id = '0' OR gz.zone_country_id = '222') AND (gz.zone_id IS null OR gz.zone_id = '0' OR gz.zone_id = '0'), products_description pd, products_to_categories p2c WHERE p.products_status = '1' AND p.products_id = pd.products_id AND pd.language_id = '1' AND p.products_id = p2c.products_id AND p2c.categories_id IN () AND p.products_exclude_from_search = '0' GROUP BY p.products_id ORDER BY rand() LIMIT 10

[TEP STOP]