You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) ORDER BY sort_order, _name_sort' at line 1
SELECT p.*, name_ru AS _name_sort FROM SC_products p WHERE (categoryID IN (593)) AND ( enabled=1 AND ordering_available=1 AND p.categoryID NOT IN ()) ORDER BY sort_order, _name_sort