SELECT
pr.product_id,
pr.product_ean AS sku,
pr.product_publish,
pr.`name_ru-RU` AS NAME,
pr.`alias_ru-RU` AS slug,
pr.`short_description_ru-RU` AS short_description,
pr.`description_ru-RU` AS description,
pr.`meta_title_ru-RU` AS meta_title,
pr.`meta_description_ru-RU` AS meta_description,
pr.`meta_keyword_ru-RU` AS meta_keyword,
pr.`product_weight` AS weight,
man.`name_ru-RU` AS man_name,
GROUP_CONCAT(cat.`name_ru-RU` SEPARATOR '\\') AS namescats,
GROUP_CONCAT(images.image_name SEPARATOR '|') AS imagess,
pr.product_quantity AS qty,
pr.image AS image,
pr.product_price,
gr1.price as price_rozn,
gr2.price as price_opt,
gr3.price as price_dealer,
pr.label_id,
pr.vendor_id,
V.f_name AS v_f_name,
V.l_name AS v_l_name
FROM
`#prefix#_jshopping_products` AS pr
LEFT JOIN `#prefix#_jshopping_products_to_categories` AS pr_cat USING(product_id)
LEFT JOIN `#prefix#_jshopping_categories` AS cat
ON
pr_cat.category_id = cat.category_id
LEFT JOIN `#prefix#_jshopping_products_images` AS images
ON
pr.product_id = images.product_id
LEFT JOIN `#prefix#_jshopping_manufacturers` AS man
ON
pr.product_manufacturer_id = man.manufacturer_id
LEFT JOIN `#prefix#_jshopping_products_prices_group` AS gr1
ON
pr.product_id = gr1.product_id AND gr1.group_id=1
LEFT JOIN `#prefix#_jshopping_products_prices_group` AS gr2
ON
pr.product_id = gr2.product_id AND gr2.group_id=2
LEFT JOIN `#prefix#_jshopping_products_prices_group` AS gr3
ON
pr.product_id = gr3.product_id AND gr3.group_id=3
LEFT JOIN `#prefix#_jshopping_vendors` AS V
ON
pr.vendor_id = V.id
WHERE
pr.parent_id = 0
GROUP BY
pr.product_id;