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 (
1947, 1458, 1460, 1464, 1455, 1382, 1385,
1383, 1386, 25, 1758, 1757, 1734, 1254,
1684, 1379, 1378, 1792, 1791, 1793,
1789, 1716, 1714, 1715, 1720, 1719,
1722, 1713, 1718, 1717, 1867, 1721,
1685, 1207, 1210, 1203, 1389, 1188,
1190, 1209, 1186, 1852, 1456, 1457,
1045, 1046, 1187, 1577, 1194, 368, 1253
)
AND a.status = 'A'
ORDER BY
a.position