SELECT
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'
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
a.product_id IN (
1431, 360, 1479, 1478, 414, 1866, 1427,
788, 1084, 1407, 1903, 1452, 1453, 538,
1864, 1863, 1461, 1199, 1943, 1901,
1200, 1212, 1939, 1211, 759, 1415, 1255,
1796, 23, 24, 1468, 1466, 1467, 1482,
1484, 1568, 1535, 1566, 1567, 1444,
1418, 1443, 1054, 1369, 1370, 60, 808,
1274
)
AND a.status = 'A'
ORDER BY
a.position