Skip to content

Commit ab99bc1

Browse files
committed
ACP2E-1172: categoryList Graphql request show 0 product count
1 parent 89bf244 commit ab99bc1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
7171
}
7272
/** @var Category $category */
7373
$category = $value['model'];
74+
$isAnchored = $category->getIsAnchor();
75+
if (!empty($value['id']) && !$isAnchored) {
76+
$isAnchored = $this->categoryRepository->get($value['id'])->getIsAnchor();
77+
}
78+
$category->setIsAnchor($isAnchored);
7479
$productsCollection = $category->getProductCollection();
7580
$productsCollection->setVisibility($this->catalogProductVisibility->getVisibleInSiteIds());
7681
$productsCollection = $this->collectionProcessor->process(

0 commit comments

Comments
 (0)