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 = 'vi'
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 (
1524, 1562, 1509, 1952, 1700, 1589, 1492,
1316, 1690, 1729, 1637, 1731, 1636,
1638, 1639, 1629, 1631, 1630, 1622,
1615, 1621, 1907, 1955, 1663, 1674,
1490, 1746, 1831, 1832, 1591, 1737,
1805, 1647, 1774, 281, 1617, 282, 1503,
285, 1826, 1646, 1580, 1906, 1611, 67,
1252, 1930, 1561
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position