Skip to content

Commit

Permalink
fix: added check for comment approval
Browse files Browse the repository at this point in the history
  • Loading branch information
samberrry committed Sep 5, 2022
1 parent 0073146 commit 0a02241
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ps_facetedsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0a02241

Please sign in to comment.