SELECT
c.product_id AS cur_product_id,
a.*,
b.option_name,
b.internal_option_name,
b.option_text,
b.description,
b.inner_hint,
b.incorrect_message,
b.comment
FROM
cscart_product_options as a
LEFT JOIN cscart_product_options_descriptions as b ON a.option_id = b.option_id
AND b.lang_code = 'ru'
LEFT JOIN cscart_product_global_option_links as c ON c.option_id = a.option_id
INNER JOIN cscart_ult_objects_sharing ON (
cscart_ult_objects_sharing.share_object_id = a.option_id
AND cscart_ult_objects_sharing.share_company_id = 1
AND cscart_ult_objects_sharing.share_object_type = 'product_options'
)
WHERE
c.product_id IN (
315850, 315943, 316618, 323594, 323621,
324557, 73605, 87023, 265180, 300746,
305637, 312771, 323588, 324430, 325131,
325407, 228357, 261812, 293942, 301454,
311274, 312663, 323303, 323592, 323617,
323627, 325112, 325133, 265183, 286299,
292637, 305636, 323586, 323587, 326296,
327385, 328466, 302560, 305634, 305635,
311273, 312778, 312795, 312812, 315904,
323590, 323591, 323593, 323868, 325122,
325132, 325561, 227930, 300730, 305638,
323589, 325842, 328159, 300747, 312765,
312793, 312794, 315903, 325109, 330705,
306671, 312633, 324549, 185419, 269163,
273172, 299568, 300753, 302068, 312659,
325126, 327998, 328311, 185033, 229515
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position