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 (
40629, 79914, 40775, 40774, 40621, 40620,
40616, 40948, 40187, 40186, 40185,
40779, 40778, 40231, 40174, 79928,
40167, 40166, 40165, 40531, 40773,
40772, 40157, 40156, 40152, 40151,
40150, 40069, 40111, 40110, 40857,
40106, 40102, 40101, 40099, 40098,
40097, 40096, 40088, 40087, 40081,
40092, 40007, 40006, 40005, 39997,
39994, 39982, 39980, 39977, 39976,
39975, 39974, 39973, 39972, 39971,
39970, 39969, 39968, 39967, 39966,
39962, 39950, 79918, 40105, 39991,
39960, 39923, 39916, 39907, 39906,
91051, 91050, 91049, 91048, 91047,
91046, 91045, 91044, 91043
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position