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 = 'uk'
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 (
19860, 19820, 19863, 19865, 19866, 20154,
19867, 19868, 19869, 19870, 19871,
19872, 19873, 19875, 19874, 19876,
20087, 19877, 19878, 19879, 19880,
19881, 19882, 19883, 19884, 19885,
19886, 19888, 19889, 19890, 19891,
19892, 19893, 19894, 19895, 19896,
19897, 19898, 19899, 19900, 19901,
19902, 19903, 19904, 19905, 19925,
19906, 19907, 19908, 19909, 19910,
19911, 20576, 20088, 20089, 20091,
20092, 20093, 20094, 18661, 18662,
19131, 18664, 20724, 20725, 20728,
20955, 20956, 20957, 20958, 20959,
22277, 20971, 21078, 21102, 20972,
20973, 20974, 21103, 21923, 21924,
21925, 21926, 20065, 19887, 21749,
20723, 20726, 20727
)
AND a.product_id = 0
AND a.status = 'A'
ORDER BY
a.position