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 (
40303, 40302, 40301, 40300, 40299, 40298,
40297, 79897, 39728, 39507, 39506,
39377, 39398, 39447, 39332, 39319,
39318, 39313, 39267, 39266, 39265,
39264, 39263, 39260, 39259, 39641,
39255, 39247, 39246, 39225, 39224,
39223, 39184, 39183, 39270, 39147,
39393, 39391, 39390, 39389, 39387,
39385, 39383, 39382, 39381, 39644,
39144, 39143, 39142, 39141, 39140,
39139, 39138, 39137, 39136, 39135,
39134, 39133, 39132, 39131, 39130,
39129, 39128, 39127, 39069, 39068,
39067, 39066, 39065, 39064, 79921,
39118, 39117, 39116, 39115, 39034,
70800, 70799, 70798, 70797
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position