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 (
52874, 52873, 52872, 52871, 52870, 52869,
52868, 52867, 52866, 52865, 52864,
52863, 52862, 52861, 52860, 52859,
52858, 52857, 52856, 52979, 52908,
52890, 52889, 52888, 52828, 52820,
52819, 53140, 53139, 52807, 52806,
52805, 52804, 53031, 53030, 52786,
52785, 52784, 53088, 52774, 52891,
52880, 52757, 52749, 52748, 52747,
52746, 52778, 52758, 52685, 52709,
52687, 52686, 52682, 52677, 52671,
52670, 52669, 52942, 52941, 52940,
52939, 52636, 52635, 52645, 52644,
52643, 52642, 52589, 52588, 52587,
52586, 52585, 59345, 52633, 52632,
52578, 52542, 52524, 52707
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position