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 = 'en'
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 (
49614, 49613, 49612, 49611, 49610, 49609,
49608, 49607, 49606, 49605, 49604,
49603, 49602, 49601, 49556, 49906,
49561, 49552, 49551, 49500, 49330,
49329, 49499, 49498, 50076, 49497,
49459, 49435, 49291, 49290, 49726,
49450, 49454, 49453, 49238, 49237,
49236, 49407, 49281, 49243, 49242,
49241, 49224, 49223, 49348, 49347,
49346, 49207, 49190, 49189, 49188,
49183, 49182, 49181, 49180, 49179,
49178, 49177, 49176, 49175, 49174,
49173, 49172, 49171, 49170, 49169,
49343, 49304, 49303, 49302, 49282,
49165, 49141, 49140, 49139, 49138,
49153, 49152, 49151, 49150
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position