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 (
46924, 46923, 46922, 46873, 46872, 46871,
46870, 46869, 46868, 46867, 46866,
46865, 46864, 46863, 46862, 46861,
46860, 46859, 46858, 46857, 46624,
46568, 46567, 46565, 46822, 46821,
46820, 46819, 46901, 46900, 46899,
46898, 46897, 46896, 46895, 46894,
46893, 46892, 46891, 46890, 46889,
46888, 46887, 46886, 46885, 46884,
46883, 46882, 46881, 46880, 46879,
46878, 46877, 46621, 46620, 46619,
46618, 46617, 46616, 46615, 46614,
46613, 46535, 46534, 46533, 46532,
46519, 46477, 46472, 46471, 46437,
46702, 46701, 46700, 46699, 46348,
46329, 46580, 46579, 46358
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position