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 (
1692, 1695, 1694, 1693, 1691, 1690, 1688,
1678, 1680, 1681, 1664, 1687, 1685,
1684, 1677, 1644, 1674, 1673, 1672,
1671, 1670, 1669, 1668, 1667, 1666,
1665, 1663, 1660, 1662, 255, 1661, 1658,
1657, 1656, 1655, 1654, 1653, 1652,
1651, 1650, 1324, 1647, 1646, 1645,
1643, 1642, 1641, 1640
)
AND a.status = 'A'
ORDER BY
a.position