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 (
1788, 1697, 1657, 1687, 1921, 1238, 1197,
1307, 1306, 1940, 1941, 1660, 1751,
1677, 1305, 1588, 1662, 1635, 1747,
1587, 1771, 1709, 1957, 1707, 1768,
1710, 1954, 1953, 1730, 1686, 1593,
1594, 1616, 1773, 1701, 1584, 1585,
1868, 1579, 1956, 1495, 1739, 1740,
1912, 1913, 1650, 56, 1836
)
AND a.status = 'A'
ORDER BY
a.position