Notice: Error: Unknown column 'p.sort_price' in 'order clause'
Error No: 1054
SELECT p.product_id, p.price as sort_price, p.price AS price, (SELECT AVG(rating) AS total FROM review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating FROM product p LEFT JOIN product_description pd ON (p.product_id = pd.product_id) LEFT JOIN product_special ps ON ( p.product_id = ps.product_id ) WHERE pd.language_id = '1' AND p.status = '1' AND p.date_available <= NOW() GROUP BY p.product_id ORDER BY p.quantity DESC , p.sort_price ASC, LCASE( ASC in /var/www/www-root/data/www/ on line 49