We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 90a479f + 85a9cd3 commit 8f64121Copy full SHA for 8f64121
app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php
@@ -2121,7 +2121,9 @@ private function getChildrenCategories(int $categoryId): array
2121
if (in_array($category['parent_id'], $categoryIds)
2122
&& in_array($category['parent_id'], $anchorCategory)) {
2123
$categoryIds[] = (int)$category[$linkField];
2124
- if ($category['is_anchor'] == 1) {
+ // Storefront approach is to treat non-anchor children of anchor category as anchors.
2125
+ // Adding their's IDs to $anchorCategory for consistency.
2126
+ if ($category['is_anchor'] == 1 || in_array($category['parent_id'], $anchorCategory)) {
2127
$anchorCategory[] = (int)$category[$linkField];
2128
}
2129
0 commit comments