MySQL Query Error: SELECT b_catalog_store_product.STORE_ID AS STORE, b_catalog_store_product.PRODUCT_ID AS PRODUCT, IFNULL(b_uts_cat_store.UF_PUBLICK_NAME, b_catalog_store.TITLE) AS NAME, b_catalog_store.ADDRESS AS ADDRESS, b_catalog_store.GPS_N AS GPS_N, b_catalog_store.GPS_S AS GPS_S, b_catalog_store.SCHEDULE AS SCHEDULE, b_catalog_store.IMAGE_ID AS IMAGE_ID, b_catalog_store.EMAIL AS EMAIL, b_catalog_store_product.AMOUNT AS STORE_QUANTITY, IFNULL(sum(s_products_reserve_new.RESERVE), 0) AS RESERVE, (SELECT IF(b_catalog_store_product.PRODUCT_ID IN (0) AND b_uts_cat_store.UF_S_CITY IN (0), 5, IF((b_catalog_store_product.AMOUNT - IFNULL(sum(s_products_reserve_new.RESERVE), 0)) < 0, 0, (b_catalog_store_product.AMOUNT - IFNULL(sum(s_products_reserve_new.RESERVE), 0))))) AS TOTAL_QUANTITY, IF(IFNULL(b_iblock_element_property.VALUE, 0) > IFNULL(b_uts_cat_store.UF_MIN_QUANTITY, 0), b_iblock_element_property.VALUE, b_uts_cat_store.UF_MIN_QUANTITY) AS PRODUCT_QUANTITY_TO_SHOW, b_uts_cat_store.UF_CITY AS CITY, b_uts_cat_store.UF_STORE_METRO as METRO, b_uts_cat_store.UF_HOLIDAYS as UF_HOLIDAYS, b_uts_cat_store.UF_GALERY_PHOTO as UF_GALERY_PHOTO, b_uts_cat_store.UF_CERVICES as UF_CERVICES, b_uts_cat_store.UF_STORE_COLOR as METRO_COLOR FROM b_catalog_store_product LEFT JOIN s_products_reserve_new ON b_catalog_store_product.PRODUCT_ID = s_products_reserve_new.PRODUCT_ID AND b_catalog_store_product.STORE_ID = s_products_reserve_new.STORE_ID LEFT JOIN b_catalog_store ON (b_catalog_store_product.STORE_ID = b_catalog_store.ID AND b_catalog_store.ACTIVE = 'Y') LEFT JOIN b_iblock_element_property ON b_iblock_element_property.IBLOCK_ELEMENT_ID = b_catalog_store_product.PRODUCT_ID AND IBLOCK_PROPERTY_ID = 567 LEFT JOIN b_uts_cat_store ON b_catalog_store_product.STORE_ID = b_uts_cat_store.VALUE_ID WHERE b_catalog_store_product.PRODUCT_ID IN () AND ((b_uts_cat_store.UF_PICKUP_OFF = 0 OR b_uts_cat_store.UF_PICKUP_OFF IS NULL) OR b_catalog_store_product.STORE_ID = 2) AND (b_uts_cat_store.UF_S_CITY = 3764 OR b_catalog_store_product.STORE_ID = 2) AND (SELECT b_iblock_element_property.VALUE FROM b_iblock_element_property WHERE b_iblock_element_property.IBLOCK_ELEMENT_ID = b_catalog_store_product.PRODUCT_ID AND b_iblock_element_property.IBLOCK_PROPERTY_ID = 548) <> 445 AND (82 NOT IN (SELECT b_iblock_element_property.VALUE FROM b_iblock_element_property WHERE b_iblock_element_property.IBLOCK_ELEMENT_ID = b_catalog_store_product.PRODUCT_ID AND b_iblock_element_property.IBLOCK_PROPERTY_ID = 665 and b_catalog_store_product.STORE_ID <> 2) AND b_catalog_store_product.STORE_ID <> 2 OR b_catalog_store_product.STORE_ID = 2 ) GROUP BY PRODUCT, STORE HAVING (TOTAL_QUANTITY >= (SELECT IF (b_catalog_store_product.STORE_ID = 2, 1, IFNULL(PRODUCT_QUANTITY_TO_SHOW, 2))));[[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 ((b_uts_cat_store.UF_PICKUP_OFF = 0 OR b_uts_cat_store' at line 29]

DB query error.
Please try later.