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 (
87668, 87667, 87689, 87688, 87651, 87790,
87789, 87681, 87758, 87757, 87756,
87755, 87684, 87677, 87585, 87885,
88049, 88048, 88047, 88046, 88045,
87873, 87766, 87765, 87646, 87590,
87589, 88131, 88130, 88129, 88128,
88071, 88070, 88069, 88057, 88056,
88055, 87482, 87481, 87487
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position