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 = 'kk'
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 (
17792, 17791, 17790, 17789, 17788, 17787,
17786, 17785, 17784, 17775, 17774,
17773, 17772, 17753, 17752, 17751,
17750, 17749, 17748, 17747, 17746,
17745, 17744, 17743, 17742, 17783,
17782, 17781, 17780, 17779, 17778,
17777, 17776, 17741, 17740, 17739,
17738, 17737, 17771, 17770, 17769,
17768, 17767, 17766, 17765, 17764,
17763, 17762, 17761, 17760, 17759,
17758, 17757, 17756, 17755, 17754,
17736, 17735, 17734, 17733, 17730,
17732, 17731, 17729, 17728, 17727,
17726, 17725, 17667, 17679, 17678,
17677, 17676, 17675, 17674, 17673,
17672, 17671, 17670, 17669
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position