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 = 'ru'
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 (
9937, 9573, 9574, 9575, 9576, 9577, 9672,
9578, 9638, 9643, 9671, 9581, 9582,
9584, 9585, 8687, 9685, 9954, 9681,
9682, 9955, 9683, 9686, 9956, 9758,
9612, 9730, 9616, 8933, 9732, 9735,
9587, 9589, 9599, 8936, 9565, 9600,
9604, 9606, 9947, 9621, 9610, 8939,
9611, 9664, 9665, 9748, 9564, 9750,
9623, 9958, 9960, 9666, 9952, 9959,
9949, 9753, 9944, 9754, 9562, 9756,
8983, 9673, 9961, 9957, 9757, 9626,
9627, 9629, 9630, 9632, 9633, 9635,
9640, 9945, 9950, 9641, 8945, 9625,
9645, 9647, 9677, 9648, 9953, 9650,
9921, 8941, 9922, 9923, 9925, 9924,
9745, 9651, 9652, 9746, 9654, 9926,
9655, 9927, 9734
)
AND a.status = 'A'
ORDER BY
a.position