From 9f61b0677dc9fc2abbf62afc3ff3c8320d935cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alvaro=20C=C3=A1nepa?= Date: Mon, 15 Jan 2018 07:52:12 -0300 Subject: [PATCH 1/3] Fix for nesting property --- classes/helper/CatalogMenuType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/helper/CatalogMenuType.php b/classes/helper/CatalogMenuType.php index 8e3609dd..73805661 100644 --- a/classes/helper/CatalogMenuType.php +++ b/classes/helper/CatalogMenuType.php @@ -34,7 +34,7 @@ public function resolveMenuItem($obMenuItem, $sURL) /** @var \Lovata\Shopaholic\Classes\Item\CategoryItem $obCategoryItem */ foreach ($obCategoryList as $obCategoryItem) { $arMenuItem = $this->getCategoryMenuData($obCategoryItem, $obMenuItem->cmsPage, $sURL); - $arMenuItem['items'] = $this->getChildrenCategoryList($obCategoryItem, $obMenuItem->cmsPage, $sURL); + $arMenuItem['items'] = ($obMenuItem->nesting) ? $this->getChildrenCategoryList($obCategoryItem, $obMenuItem->cmsPage, $sURL) : []; $arResult['items'][] = $arMenuItem; } From c5397387adff0e3b956a878a457f2ae4e4534cef Mon Sep 17 00:00:00 2001 From: Andrey Kharanenka Date: Mon, 15 Jan 2018 21:04:06 +0300 Subject: [PATCH 2/3] Fix: processing of the "nesting" flag for the menu type "catalog" --- classes/helper/CatalogMenuType.php | 4 +++- updates/version.yaml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/classes/helper/CatalogMenuType.php b/classes/helper/CatalogMenuType.php index 73805661..1847da83 100644 --- a/classes/helper/CatalogMenuType.php +++ b/classes/helper/CatalogMenuType.php @@ -34,7 +34,9 @@ public function resolveMenuItem($obMenuItem, $sURL) /** @var \Lovata\Shopaholic\Classes\Item\CategoryItem $obCategoryItem */ foreach ($obCategoryList as $obCategoryItem) { $arMenuItem = $this->getCategoryMenuData($obCategoryItem, $obMenuItem->cmsPage, $sURL); - $arMenuItem['items'] = ($obMenuItem->nesting) ? $this->getChildrenCategoryList($obCategoryItem, $obMenuItem->cmsPage, $sURL) : []; + if($obMenuItem->nesting) { + $arMenuItem['items'] = $this->getChildrenCategoryList($obCategoryItem, $obMenuItem->cmsPage, $sURL); + } $arResult['items'][] = $arMenuItem; } diff --git a/updates/version.yaml b/updates/version.yaml index 28df223b..ca9501f6 100644 --- a/updates/version.yaml +++ b/updates/version.yaml @@ -15,4 +15,6 @@ 1.2.3: - '!!! Adding additional cache cleaning for the sorted list of brands, after the creation of a new brand. Requires Toolbox plugin version 1.3.0 and later.' 1.3.0: - - '!!! Add menu types for integration with the StaticPage plugin. Add getPageUrl() method to the CategoryItem class. Requires Toolbox plugin version 1.4.0 and later. Thanks for contribution Alvaro Cánepa.' \ No newline at end of file + - '!!! Add menu types for integration with the StaticPage plugin. Add getPageUrl() method to the CategoryItem class. Requires Toolbox plugin version 1.4.0 and later. Thanks for contribution Alvaro Cánepa.' +1.3.1: + - 'Fix: processing of the "nesting" flag for the menu type "catalog"' \ No newline at end of file From 7e068b0152af7b350d92b70ae38f3940b6bf2512 Mon Sep 17 00:00:00 2001 From: Andrey Kharanenka Date: Mon, 15 Jan 2018 21:06:56 +0300 Subject: [PATCH 3/3] Fix codestyle issues --- classes/helper/CatalogMenuType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/helper/CatalogMenuType.php b/classes/helper/CatalogMenuType.php index 1847da83..2d547d9a 100644 --- a/classes/helper/CatalogMenuType.php +++ b/classes/helper/CatalogMenuType.php @@ -34,7 +34,7 @@ public function resolveMenuItem($obMenuItem, $sURL) /** @var \Lovata\Shopaholic\Classes\Item\CategoryItem $obCategoryItem */ foreach ($obCategoryList as $obCategoryItem) { $arMenuItem = $this->getCategoryMenuData($obCategoryItem, $obMenuItem->cmsPage, $sURL); - if($obMenuItem->nesting) { + if ($obMenuItem->nesting) { $arMenuItem['items'] = $this->getChildrenCategoryList($obCategoryItem, $obMenuItem->cmsPage, $sURL); }