9
9
10
10
class Configuration extends Algolia implements CollectionDataSourceInterface
11
11
{
12
+ //Placeholder for future implementation (requires customer renderer for hierarchicalMenu widget)
13
+ private const IS_CATEGORY_NAVIGATION_ENABLED = false ;
14
+
12
15
public function isSearchPage ()
13
16
{
14
17
if ($ this ->getConfigHelper ()->isInstantEnabled ()) {
@@ -57,7 +60,7 @@ protected function getChildCategoryUrls(\Magento\Catalog\Model\Category $cat, st
57
60
}
58
61
59
62
foreach ($ cat ->getChildrenCategories () as $ child ) {
60
- $ key = $ parent ? $ parent . $ this ->getConfigHelper ()->getCategorySeparator () . $ child ->getName () : $ child ->getName ();
63
+ $ key = $ parent ? $ parent . $ this ->getConfigHelper ()->getCategorySeparator ($ this -> getStoreId () ) . $ child ->getName () : $ child ->getName ();
61
64
$ arr [$ key ]['url ' ] = $ child ->getUrl ();
62
65
$ arr = array_merge ($ arr , $ this ->getChildCategoryUrls ($ child , $ key , $ arr ));
63
66
}
@@ -123,7 +126,9 @@ public function getConfiguration()
123
126
124
127
if ($ category && $ category ->getDisplayMode () !== 'PAGE ' ) {
125
128
$ category ->getUrlInstance ()->setStore ($ this ->getStoreId ());
126
- $ childCategories = $ this ->getChildCategoryUrls ($ category );
129
+ if (self ::IS_CATEGORY_NAVIGATION_ENABLED ) {
130
+ $ childCategories = $ this ->getChildCategoryUrls ($ category );
131
+ }
127
132
128
133
$ categoryId = $ category ->getId ();
129
134
@@ -180,7 +185,6 @@ public function getConfiguration()
180
185
}
181
186
182
187
$ attributesToFilter = $ config ->getAttributesToFilter ($ customerGroupId );
183
-
184
188
$ algoliaJsConfig = [
185
189
'instant ' => [
186
190
'enabled ' => $ config ->isInstantEnabled (),
@@ -192,7 +196,8 @@ public function getConfiguration()
192
196
'isSearchBoxEnabled ' => $ config ->isInstantSearchBoxEnabled (),
193
197
'isVisualMerchEnabled ' => $ config ->isVisualMerchEnabled (),
194
198
'categorySeparator ' => $ config ->getCategorySeparator (),
195
- 'categoryPageIdAttribute ' => $ config ->getCategoryPageIdAttributeName ()
199
+ 'categoryPageIdAttribute ' => $ config ->getCategoryPageIdAttributeName (),
200
+ 'isCategoryNavigationEnabled ' => self ::IS_CATEGORY_NAVIGATION_ENABLED
196
201
],
197
202
'autocomplete ' => [
198
203
'enabled ' => $ config ->isAutoCompleteEnabled (),
0 commit comments