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 = 'kk'
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 (
51480, 51479, 51494, 51495, 132, 112,
3, 78, 77, 2, 87, 66, 22421, 22424, 22290,
50981, 50982, 133, 45, 143, 50983, 51416,
51043, 51471, 51413, 51421, 51057,
51547, 51459, 51470, 51472, 51500,
51529, 51457, 51464, 51460, 51501,
51412, 51530, 51551, 51053, 51467,
51478, 51051, 51510, 51486, 51044,
51469, 51531, 51461, 51047, 51437,
51477, 51473, 51525, 51516, 51532,
51048, 51475, 51458, 51462, 51463,
51514, 51538, 51540, 51545, 51468,
51503, 51520, 51541, 51476, 51522,
51539, 51491, 51499, 51513, 51519,
51474, 51492, 51509, 51515, 51466,
51485, 51502, 51528, 51508, 51550,
51465, 51518, 51543, 51524, 51504,
51046, 51512, 51527, 51511, 51482,
51505, 51542, 51546, 51439, 51544,
51493, 51548, 51438, 51054, 51535
)
AND a.status = 'A'
ORDER BY
a.position