Skip to content

Commit 615ac4e

Browse files
authored
fix: categories not included filtering on product listing (#1163)
1 parent b175db5 commit 615ac4e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Helper/Entity/ProductHelper.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,10 @@ public function setSettings($indexName, $indexNameTmp, $storeId, $saveToTmpIndic
445445
}
446446
}
447447

448-
public function getAllCategories($categoryIds)
448+
public function getAllCategories($categoryIds, $storeId)
449449
{
450-
$categories = $this->categoryHelper->getCoreCategories(false);
450+
$filterNotIncludedCategories = !$this->configHelper->showCatsNotIncludedInNavigation($storeId);
451+
$categories = $this->categoryHelper->getCoreCategories($filterNotIncludedCategories);
451452

452453
$selectedCategories = [];
453454
foreach ($categoryIds as $id) {
@@ -628,7 +629,7 @@ private function addCategoryData($customData, Product $product)
628629
$_categoryIds = $product->getCategoryIds();
629630

630631
if (is_array($_categoryIds) && count($_categoryIds) > 0) {
631-
$categoryCollection = $this->getAllCategories($_categoryIds);
632+
$categoryCollection = $this->getAllCategories($_categoryIds, $storeId);
632633

633634
/** @var Store $store */
634635
$store = $this->storeManager->getStore($product->getStoreId());

0 commit comments

Comments
 (0)