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 = 'vi'
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 (
397, 511, 1023, 1022, 847, 525, 577, 576,
658, 659, 932, 656, 657, 376, 540, 592,
1015, 767, 1088, 572, 619, 355, 342,
547, 591, 902, 323, 757, 1236, 1225,
294, 47, 48, 356, 1293, 1242, 846, 593,
616, 1087, 520, 548, 899
)
AND a.status = 'A'
ORDER BY
a.position