File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
ReviewGraphQl/Model/Resolver/Product/Review Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
class Config
17
17
{
18
- const XML_PATH_WISHLIST_ACTIVE = 'catalog/review/active ' ;
18
+ const XML_PATH_REVIEW_ACTIVE = 'catalog/review/active ' ;
19
19
20
20
/**
21
21
* @var ScopeConfigInterface
@@ -39,7 +39,7 @@ public function __construct(
39
39
public function isEnabled (): bool
40
40
{
41
41
return $ this ->scopeConfig ->isSetFlag (
42
- self ::XML_PATH_WISHLIST_ACTIVE ,
42
+ self ::XML_PATH_REVIEW_ACTIVE ,
43
43
ScopeInterface::SCOPE_STORES
44
44
);
45
45
}
Original file line number Diff line number Diff line change @@ -64,9 +64,9 @@ public function resolve(
64
64
/** @var Review $review */
65
65
$ review = $ value ['model ' ];
66
66
$ summary = $ this ->ratingFactory ->create ()->getReviewSummary ($ review ->getId ());
67
- $ averageRating = $ summary ->getSum ();
67
+ $ averageRating = $ summary ->getSum () ?: 0 ;
68
68
69
- if ($ summary -> getSum () > 0 ) {
69
+ if ($ averageRating > 0 ) {
70
70
$ averageRating = (float ) number_format ($ summary ->getSum () / $ summary ->getCount () / 20 , 2 );
71
71
}
72
72
You can’t perform that action at this time.
0 commit comments