FROM #__hikashop_product_category AS a LEFT JOIN #__hikashop_product AS b ON a.product_id=b.product_id LEFT JOIN #__hikashop_category AS man ON b.product_manufacturer_id = man.category_id WHERE (b.product_published = 1) AND (b.product_type = 'main') AND (a.category_id IN (14)) AND ((b.product_access = 'all' OR b.product_access LIKE '%,9,%')) ORDER BY man.category_ordering, a.ordering ASC