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 (
14819, 14818, 39047, 14808, 14807, 23244,
23237, 14795, 14720, 14713, 14730,
14728, 14726, 14723, 14722, 14787,
14701, 76378, 76377, 14677, 14663,
14662, 14661, 14660, 14659, 14658,
14657, 14656, 14654, 14653, 14652,
14651, 14649, 14648, 14647, 14646,
14645, 14644, 14643, 14642
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position