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 (
41027, 41026, 41025, 41024, 41023, 41022,
41021, 41020, 41019, 41018, 40998,
40954, 40896, 40895, 40894, 40888,
41357, 41356, 41355, 41354, 41353,
41352, 41351, 41350, 41349, 41348,
41347, 41346, 41345, 41344, 41343,
41342, 41341, 41340, 41338, 41337,
41336, 41335, 41334, 41333, 41332,
41331, 41330, 41329, 41328, 41327,
41326, 41325, 41324, 41140, 40854,
40853, 41004, 41003, 41002, 40946,
40842, 40841, 40837, 40836, 40835,
40834, 40833, 40872, 40866, 41147,
40784, 40783, 40777, 40776, 40798,
40797, 40686, 40671, 79898, 40781,
40780, 40642, 41150, 40634
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position