select distinct p.products_id, p.products_price, p.products_tax_class_id, pd.products_name, p.products_image
from products p
inner join products_description pd on (p.products_id = pd.products_id)
inner join products_to_categories p2c on (p.products_id = p2c.products_id)
inner join categories c on (p2c.categories_id = c.categories_id)
where p.products_status = 1 and p.products_ordered > 0 and pd.language_id = 3 and (c.categories_id = 365215 OR c.parent_id = 365215)
order by p.products_ordered desc, pd.products_name
limit 3