Exception: Error: Unknown column 'ps.quantity' in 'SELECT'
Error No: 1054
select p.*, c.name as category, c.alias as category_alias, ps.price as special, ps.quantity as special_quantity, ps.used as special_used, ps.start_date as special_start, ps.end_date as special_end, (select ROUND(avg(rating), 1) from pd__product_reviews r1 left join pd__products p1 on (r1.product_id = p1.id) where (`p1`.`id` = `p`.id or `p1`.`master_id` = `p`.id or `p1`.`master_id` = `p`.`master_id`) and `r1`.`status` = 1) as rating, (select count(*) from pd__product_reviews r2 left join pd__products p2 on (r2.product_id = p2.id) where (`p2`.`id` = `p`.id or `p2`.`master_id` = `p`.id or `p2`.`master_id` = `p`.`master_id`) and `r2`.`status` = 1) as reviews, (select count(*) from `pd__product_likes` lk where `lk`.`product_id` = `p`.`id` and `liked` = 1) as totalLikes, 0 as liked from pd__products p left join pd__product_specials ps on (ps.product_id = p.id and ((ps.start_date is null or UNIX_TIMESTAMP(ps.start_date) < UNIX_TIMESTAMP('2025-06-01 15:46:09')) and (ps.end_date is null or UNIX_TIMESTAMP(ps.end_date) > UNIX_TIMESTAMP('2025-06-01 15:46:09')) and (ps.quantity is null or ps.quantity > 0))) left join pd__categories c on (p.category_id = c.id) where p.id = '502' order by ps.priority asc, ps.price asc limit 1 in /home/startplus/domains/startplus.vn/public_html/web/system/library/db/mysqli.php on line 43