From 0a022417a0ab6574f19a1ccb16423b63f3c56156 Mon Sep 17 00:00:00 2001 From: Sam Berry Date: Mon, 20 Jun 2022 15:14:47 -0400 Subject: [PATCH] fix: added check for comment approval --- ps_facetedsearch.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ps_facetedsearch.php b/ps_facetedsearch.php index b72b4e781..211ed4e2f 100644 --- a/ps_facetedsearch.php +++ b/ps_facetedsearch.php @@ -1573,11 +1573,16 @@ public function indexReviews($full = false) } } else { + $validateCondition = ''; + if (Configuration::get('PRODUCT_COMMENTS_MODERATE')){ + $validateCondition = ' AND WHERE validate = 1'; + } + $query = 'SELECT pc.id_product_comment, pc.id_product, pc.grade ' . 'FROM ' . _DB_PREFIX_ . '_product_comment as pc ' . 'LEFT JOIN ' . _DB_PREFIX_ . '_layered_comment_index_log as lc ' . 'pc.id_product_comment = lc.id_comment ' . - 'WHERE lc.indexed IS NULL'; + 'WHERE lc.indexed IS NULL' . $validateCondition; //returns non matching records foreach ($this->getDatabase()->executeS($query) as $commentLog) {