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 (
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, 1438, 1954, 1953, 1730, 1686,
1593, 1594, 1616, 1773, 1701, 1584,
1585, 1868, 1579, 1956, 1495, 1739,
1740, 1912, 1913, 1650, 56, 1836, 1336,
1837, 1820, 1304, 1738, 1893, 1895,
1894, 1641, 1500, 1317, 1670, 1658,
1669, 1558, 1644, 1262, 1552, 1398,
1595, 1576, 1870, 1691, 1776, 1785,
1633, 1563, 1564, 1667, 1786, 1945,
1910, 1787, 1308, 1642, 1772, 1736,
1277, 1672, 1325, 1665, 1778, 1775,
1671, 1649, 1909, 1948
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position