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 (
1401, 1402, 1403, 1384, 727, 729, 726,
1583, 251, 237, 238, 373, 372, 339, 365,
236, 786, 381, 389, 1914, 1321, 1368,
1877, 1876, 1878, 1806, 1794, 1807,
1884, 1886, 1889, 1890, 1881, 1879,
1880, 1882, 1888, 1871, 1887, 715, 714,
1485, 1915, 345, 1451, 1183, 18, 17,
19, 1814, 1813, 1874, 1875, 974, 1574,
1575, 1812, 1811, 1507, 1853, 1856,
1918, 1919, 1862, 1861, 1857, 1883,
1860, 1859, 1854, 1923, 1858, 1922,
1855, 1920, 1469, 344, 1850, 1551, 284,
1475, 1276, 1569, 1198, 1179, 1281,
926, 1258, 1168, 1394, 1259, 1865, 390,
1204, 1864, 1863
)
AND a.status = 'A'
ORDER BY
a.position