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 (
20673, 20947, 22253, 20168, 19430, 19431,
19432, 19438, 19439, 19440, 19443,
19444, 19445, 19760, 19761, 19814,
19815, 19816, 19817, 19819, 19861,
20674, 22462, 21341, 19934, 19138,
19433, 19434, 19435, 19436, 19437,
19441, 19442, 19759, 19818, 19932
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position