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 (
1828, 1675, 1931, 1544, 1845, 1540, 1512,
1525, 1536, 1538, 1937, 1581, 1582,
1838, 1938, 1830, 1514, 1835, 1678,
1693, 1711, 1699, 1698, 1869, 1834,
1833, 1928, 1537, 1539, 1381, 1320,
359, 1892, 1898, 1899, 1436, 1411, 1397,
1741, 1270, 1376, 1301, 1330, 1215,
1439, 1323, 717, 1217
)
AND a.status = 'A'
ORDER BY
a.position