Skip to content

Commit 3aba969

Browse files
committed
ACP2E-1172: categoryList Graphql request show 0 product count
1 parent 54ef0f7 commit 3aba969

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/Category/ProductsCount.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
7171
}
7272
/** @var Category $category */
7373
$category = $value['model'];
74+
$category->setIsAnchor($category->getIsAnchor() ?? $this->categoryRepository->get($value['id'])->getIsAnchor());
7475

75-
if (!$category->getIsAnchor() !== null) {
76-
$category->setIsAnchor($this->categoryRepository->get($value['id'])->getIsAnchor());
77-
}
7876
$productsCollection = $category->getProductCollection();
7977
$productsCollection->setVisibility($this->catalogProductVisibility->getVisibleInSiteIds());
8078
$productsCollection = $this->collectionProcessor->process(

0 commit comments

Comments
 (0)