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 (
51830, 51829, 59337, 52214, 51828, 51816,
51812, 51811, 51786, 51785, 51813,
51802, 51801, 51800, 51799, 51798,
51797, 51796, 51795, 51794, 51793,
51792, 51791, 51790, 51789, 51788,
51753, 51752, 51751, 51750, 51782,
51735, 91670, 91669, 91668, 51653,
51646, 51638, 51637, 51636, 51635,
111382, 51609, 51605, 51587, 51581,
51580, 51666, 51665, 51664, 51663,
51662, 51557, 51555, 51534, 51533,
51532, 51531, 51530, 51529, 51520,
51437, 51694, 51430, 51425, 51338,
51337, 51319, 51768, 51418, 51287,
51198, 51127, 51126, 51098, 51097,
51096, 51095, 51094, 51093
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position