SELECT
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'
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
a.product_id IN (
20337, 20999, 20206, 21383, 20995, 20590,
20207, 20210, 20994, 21401, 21393,
20791, 21387, 20478, 20481, 21388,
21023, 21024, 21026, 21025, 21028,
22540, 22541, 22542, 22543, 22544
)
AND a.status = 'A'
ORDER BY
a.position