Skip to content

Commit f168ca6

Browse files
committed
Small improvements
1 parent 0111b2d commit f168ca6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/code/Magento/Review/Model/Review/Config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
class Config
1717
{
18-
const XML_PATH_WISHLIST_ACTIVE = 'catalog/review/active';
18+
const XML_PATH_REVIEW_ACTIVE = 'catalog/review/active';
1919

2020
/**
2121
* @var ScopeConfigInterface
@@ -39,7 +39,7 @@ public function __construct(
3939
public function isEnabled(): bool
4040
{
4141
return $this->scopeConfig->isSetFlag(
42-
self::XML_PATH_WISHLIST_ACTIVE,
42+
self::XML_PATH_REVIEW_ACTIVE,
4343
ScopeInterface::SCOPE_STORES
4444
);
4545
}

app/code/Magento/ReviewGraphQl/Model/Resolver/Product/Review/AverageRating.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ public function resolve(
6464
/** @var Review $review */
6565
$review = $value['model'];
6666
$summary = $this->ratingFactory->create()->getReviewSummary($review->getId());
67-
$averageRating = $summary->getSum();
67+
$averageRating = $summary->getSum() ?: 0;
6868

69-
if ($summary->getSum() > 0) {
69+
if ($averageRating > 0) {
7070
$averageRating = (float) number_format($summary->getSum() / $summary->getCount() / 20, 2);
7171
}
7272

0 commit comments

Comments
 (0)