SELECT distinct products.sku, products.product_name, products.slug, products.description_short, product_controls.price, products.clearance_item, products.clearance_quantity, products.discontinued, product_controls.sale_price, product_controls.sale_date_start, product_controls.sale_date_end, product_controls.sale_badge, product_controls.number_sold, products.primaries, manufacturers.name as manufacturer_name, (SELECT parent_id FROM categories WHERE categories.id = products.category_id OR categories.id = products.secondary_category_id LIMIT 1) as parent_id, (SELECT sort_order FROM categories WHERE categories.id = products.category_id OR categories.id = products.secondary_category_id LIMIT 1) as sort_order, (SELECT category FROM categories WHERE categories.id = products.category_id OR categories.id = products.secondary_category_id LIMIT 1) as category, (SELECT AVG(rating) FROM reviews WHERE product_sku = products.sku) as avg_score FROM products JOIN manufacturers ON products.manufacturer_id = manufacturers.id JOIN product_controls ON product_controls.sku = products.sku WHERE primaries = '1' AND product_controls.active = 'y' AND product_controls.site_name = 'Plus' AND categories.category = 'airfit' ORDER BY manufacturers.sort_order, manufacturer_name, product_name


Fatal error: Uncaught exception 'Exception' with message 'Error: Unknown column 'categories.category' in 'where clause'' in /var/www/vhosts/cpapwholesale.com/html/app/library/class.MYSQLAdapter.php:30 Stack trace: #0 /var/www/vhosts/cpapwholesale.com/html/app/library/class.ActiveRecordBase.php(506): MySQLAdapter::query('SELECT distinct...', Resource id #5) #1 /var/www/vhosts/cpapwholesale.com/html/app/controllers/search_controller.php(104): ActiveRecordBase::query('SELECT distinct...') #2 /var/www/vhosts/cpapwholesale.com/html/app/library/class.Application.php(144): SearchController->quick_search('?search_term=ai...') #3 /var/www/vhosts/cpapplus.com/html/index.php(4): Application::delegate('search/quick_se...') #4 {main} thrown in /var/www/vhosts/cpapwholesale.com/html/app/library/class.MYSQLAdapter.php on line 30