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 (
11964, 18422, 11851, 11814, 11672, 11852,
12946, 11919, 11853, 11673, 13219,
13349, 11815, 11674, 12421, 13087,
11675, 7778, 6943, 11854, 13382, 13168,
11731, 13383, 12516, 12517, 7278, 11941,
11942, 11676, 8062, 11677, 11678, 11732,
12947, 7995, 11733, 12214, 13073, 13384,
13385, 11734, 11943, 13350, 12518,
7896, 11855, 11679, 11856, 13386, 7541,
11850, 11680, 13074, 11681, 12215,
9699, 11857, 12948, 12949, 11682, 11683,
11805, 11684, 11735, 11858, 12216,
11685, 11736, 11686, 11687, 11688,
8159, 11859, 11737, 11689, 12950, 11944,
11860, 12217, 11738, 13262, 13387,
11816, 11861, 7658, 8377, 11862, 11863,
13089, 11690, 12073, 11864, 11739,
13169, 7161, 18099, 11865, 12519, 12520
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position