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 'ORDER BY pp, ss, oa' at line 6
SELECT IF (Price <= 2,1,0) AS pp, IF (in_stock <= 1,2,1) AS ss, IF (ordering_available = 0,2,1) AS oa, p.name_ru AS name, pict.thumbnail AS thumbnail, p.description_ru AS description, p.productID AS productID, p.Price AS Price, p.Price AS PriceWithUnit, p.brandID, p.list_price, p.in_stock ,p.enabled, p.ordering_available, p.product_code, p.brief_description_ru FROM SC_products AS p LEFT JOIN SC_product_pictures AS pict ON(pict.photoID = p.default_picture) WHERE p.brandID= ORDER BY pp, ss, oa