File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ class Filters
21
21
*/
22
22
private $ filtersProvider ;
23
23
24
+ /**
25
+ * @var array
26
+ */
27
+ private $ mappings ;
28
+
24
29
/**
25
30
* Filters constructor.
26
31
* @param FiltersProvider $filtersProvider
@@ -29,6 +34,9 @@ public function __construct(
29
34
FiltersProvider $ filtersProvider
30
35
) {
31
36
$ this ->filtersProvider = $ filtersProvider ;
37
+ $ this ->mappings = [
38
+ 'Category ' => 'category '
39
+ ];
32
40
}
33
41
34
42
/**
@@ -70,6 +78,7 @@ public function getData(string $layerType, array $attributesToFilter = null) : a
70
78
* @param AbstractFilter $filter
71
79
* @param array $attributesToFilter
72
80
* @return bool
81
+ * @throws \Magento\Framework\Exception\LocalizedException
73
82
*/
74
83
private function isNeedToAddFilter (AbstractFilter $ filter , array $ attributesToFilter ): bool
75
84
{
@@ -79,6 +88,8 @@ private function isNeedToAddFilter(AbstractFilter $filter, array $attributesToFi
79
88
if ($ filter ->hasAttributeModel ()) {
80
89
$ filterAttribute = $ filter ->getAttributeModel ();
81
90
$ result = in_array ($ filterAttribute ->getAttributeCode (), $ attributesToFilter );
91
+ } elseif (!empty ($ this ->mappings [$ filter ->getName ()])) {
92
+ $ result = in_array ($ this ->mappings [$ filter ->getName ()], $ attributesToFilter );
82
93
} else {
83
94
$ result = false ;
84
95
}
You can’t perform that action at this time.
0 commit comments