SELECT `product`.*, `product_image`.`image`, IF((product.sale_price>0), `product`.`sale_price`, product.price) AS sort_price, GROUP_CONCAT(product_options.option_id SEPARATOR ", ") as option_id
FROM `product`
LEFT JOIN `product_category` ON `product`.`content_id` = `product_category`.`content_id`
LEFT JOIN `category_master` ON `product_category`.`category_content_id` = `category_master`.`content_id`
LEFT JOIN `product_options` ON `product`.`content_id` = `product_options`.`content_id`
LEFT JOIN `product_image` ON (`product`.`content_id` = `product_image`.`content_id` AND `main_image` = 1)
WHERE `product`.`status` = 1
AND `product`.`language_slug` = 'en'
GROUP BY `product`.`content_id`
ORDER BY `product`.`sold` DESC
LIMIT 6
SELECT `product`.*, `product_image`.`image`, IF((product.sale_price>0), `product`.`sale_price`, product.price) AS sort_price, GROUP_CONCAT(product_options.option_id SEPARATOR ", ") as option_id
FROM `product`
LEFT JOIN `product_category` ON `product`.`content_id` = `product_category`.`content_id`
LEFT JOIN `category_master` ON `product_category`.`category_content_id` = `category_master`.`content_id`
LEFT JOIN `product_options` ON `product`.`content_id` = `product_options`.`content_id`
LEFT JOIN `product_image` ON (`product`.`content_id` = `product_image`.`content_id` AND `main_image` = 1)
WHERE `product`.`content_id` IN('360', '361', '384', '416', '426', '477')
AND `product`.`status` = 1
AND `product`.`language_slug` = 'en'
GROUP BY `product`.`content_id`
SELECT `product`.*, `product_image`.`image`, IF((product.sale_price>0), `product`.`sale_price`, product.price) AS sort_price, GROUP_CONCAT(product_options.option_id SEPARATOR ", ") as option_id
FROM `product`
LEFT JOIN `product_category` ON `product`.`content_id` = `product_category`.`content_id`
LEFT JOIN `category_master` ON `product_category`.`category_content_id` = `category_master`.`content_id`
LEFT JOIN `product_options` ON `product`.`content_id` = `product_options`.`content_id`
LEFT JOIN `product_image` ON (`product`.`content_id` = `product_image`.`content_id` AND `main_image` = 1)
WHERE `product`.`content_id` IN('289', '302', '435', '436', '440', '442')
AND `product`.`status` = 1
AND `product`.`language_slug` = 'en'
GROUP BY `product`.`content_id`