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 (
170, 162, 168, 61, 166, 736, 734, 732,
733, 735, 737, 1569, 258, 257, 1783,
1779, 1782, 1781, 1676, 1229, 1181,
362, 256, 452, 420, 374, 800, 1136, 224,
795, 1839, 797, 798, 1409, 367, 1393,
484, 445, 157, 388, 585, 241, 629, 590,
860, 1790, 230, 413, 681, 393, 41, 1827,
1454, 1476, 1473, 1198, 1179, 1281,
926, 1258, 1168, 1394, 1259, 1865, 390,
1412, 1066, 1399, 1204, 1387, 332, 330,
333, 329, 327, 504, 1008, 758, 1817,
1819, 1172, 1196, 1908, 1809, 1405,
1851, 730, 1481, 382, 453, 425, 1428,
1425, 1426, 1430, 1429
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position