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 (
38980, 38979, 38978, 38977, 38950, 38949,
39126, 38968, 38962, 38961, 38960,
38959, 38958, 38957, 38956, 38955,
38954, 38953, 38952, 38951, 38930,
39545, 39544, 39543, 39542, 39541,
39540, 39539, 39538, 39537, 39536,
39535, 39534, 39533, 39532, 39531,
39530, 39529, 39528, 39527, 39526,
39525, 39524, 39523, 39522, 39521,
39492, 39491, 39490, 39489, 39488,
39487, 39486, 39485, 39484, 39483,
39482, 39481, 39480, 39479, 39478,
39477, 39476, 39475, 39474, 39473,
39357, 39356, 39355, 39354, 39353,
39352, 39351, 39350, 39349, 39348,
39347, 39346, 39345, 39344
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position