From 972bad35d9aea242541fc6d6ede41c7a943d243a Mon Sep 17 00:00:00 2001 From: aneesahmadweb Date: Fri, 4 Dec 2020 14:10:22 +0500 Subject: [PATCH] Update GetProductReviews.php Only Get Approve Reviews --- src/Model/GetProductReviews.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Model/GetProductReviews.php b/src/Model/GetProductReviews.php index fa16984..fc70018 100644 --- a/src/Model/GetProductReviews.php +++ b/src/Model/GetProductReviews.php @@ -54,6 +54,7 @@ public function execute(string $sku) $collection = $this->reviewCollectionFactory->create(); $collection->addStoreData(); $collection->addFieldToFilter('sku', $sku); + $collection->addStatusFilter(\Magento\Review\Model\Review::STATUS_APPROVED); $collection->addRateVotes(); $reviews = [];