SELECT
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'
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
a.product_id IN (
18481, 18505, 18506, 18483, 18501, 18507,
18508, 18509, 18510, 18511, 18512,
18484, 18513, 18514, 18485, 18486,
18487, 18488, 18515, 18516, 18517,
18518, 18496, 18519, 18489, 18490,
18520, 18521, 18493, 18491, 18492,
18522, 18523
)
AND a.status = 'A'
ORDER BY
a.position