As every review system Opencart also using the 5star rating system where in default it prints total reviews by using the following
(SELECT COUNT(*) AS total FROM " . DB_PREFIX . "review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews,
Where I just want to count the reviews with the rating of 5 and just modified SQL as
(SELECT COUNT(*) AS total FROM " . DB_PREFIX . "review r2 WHERE r2.rating = '5' AND r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews,
But it is not working at all and displays the same result… So am I doing anything wrong… Please suggest me…
Thanks in advance