Database error: Unknown column 'cscart_product_sales.amount' in 'order clause' (1054)
Invalid query: SELECT SQL_CALC_FOUND_ROWS products.*, descr1.product as product, MIN(prices.price) as price, descr1.short_description, IF(descr1.short_description = '', descr1.full_description, '') as full_description, GROUP_CONCAT(IF(products_categories.link_type = 'M', CONCAT(products_categories.category_id, 'M'), products_categories.category_id)) as category_ids, products_categories.position FROM cscart_products as products LEFT JOIN cscart_product_options_inventory as inventory ON inventory.product_id = products.product_id LEFT JOIN cscart_product_descriptions as descr1 ON descr1.product_id = products.product_id AND descr1.lang_code = 'EN' LEFT JOIN cscart_product_prices as prices ON prices.product_id = products.product_id AND prices.lower_limit = 1 INNER JOIN cscart_products_categories as products_categories ON products_categories.product_id = products.product_id INNER JOIN cscart_categories ON cscart_categories.category_id = products_categories.category_id AND (cscart_categories.usergroup_ids = '' OR FIND_IN_SET(0, cscart_categories.usergroup_ids) OR FIND_IN_SET(1, cscart_categories.usergroup_ids)) AND cscart_categories.status IN ('A', 'H') WHERE 1 AND cscart_categories.category_id IN (646) AND products.company_id = 0 AND IF(products.tracking = 'O', inventory.amount > 0, products.amount > 0) AND (products.usergroup_ids = '' OR FIND_IN_SET(0, products.usergroup_ids) OR FIND_IN_SET(1, products.usergroup_ids)) AND products.status IN ('A') AND prices.usergroup_id IN (0, 0, 1) GROUP BY products.product_id ORDER BY cscart_product_sales.amount desc LIMIT 0, 20
Backtrace:
File: | C:\xampp\htdocs\core\fn.database.php |
Line: | 259 |
Function: | db_error |
File: | C:\xampp\htdocs\core\fn.database.php |
Line: | 29 |
Function: | db_query |
File: | C:\xampp\htdocs\core\fn.catalog.php |
Line: | 2953 |
Function: | db_get_array |
File: | C:\xampp\htdocs\controllers\customer\categories.php |
Line: | 69 |
Function: | fn_get_products |
File: | C:\xampp\htdocs\core\fn.control.php |
Line: | 568 |
Function: | include |
File: | C:\xampp\htdocs\core\fn.control.php |
Line: | 422 |
Function: | fn_run_controller |
File: | C:\xampp\htdocs\index.php |
Line: | 28 |
Function: | fn_dispatch |