Skip to content

Category Top Navigation / Maximal Depth configuration not working #7543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ovsokolov opened this issue Nov 23, 2016 · 15 comments
Closed

Category Top Navigation / Maximal Depth configuration not working #7543

ovsokolov opened this issue Nov 23, 2016 · 15 comments
Labels
bug report Component: Catalog Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@ovsokolov
Copy link

Category Top Navigation / Maximal Depth configuration not working

Preconditions

  1. Magento version 2.1.2

Steps to reproduce

  1. Magento 2.1.2 installed
  2. Register custom theme as a copy of standard theme without any modifications
  3. Crated 3 levels of categories. (Category 1 child of Default Root/ Category 2 child of Category 1/ Category 3 child of Category 2
    Category 1
    --Category 2
    ---- Category 3
  1. Configure Category Top Navigation / Maximal Depth = 1

Expected result

  1. Expect only to see Category 1 in top navigation. When hoover over Category 1 do not expect to see child categories and children of children

Actual result

  1. Can see all categories from top menu
@palamar
Copy link
Contributor

palamar commented Nov 25, 2016

Thanks for reporting this issue.

Internal task MAGETWO-61422 has been created for this issue.

@palamar palamar added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Nov 25, 2016
@palamar palamar removed their assignment Nov 25, 2016
@PascalBrouwers
Copy link
Contributor

PascalBrouwers commented Dec 15, 2016

I also have some screenshots

Setting:
category_depth_setting

Actual Menu:
category_depth_menu

@PascalBrouwers
Copy link
Contributor

It looks like this is the issue:
vendor/magento/module-theme/view/frontend/templates/html/topmenu.phtml
<?php $columnsLimit = $block->getColumnsLimit() ?: 0; ?>

I fixed it manually by setting this block argument:
<arguments> <argument name="columns_limit" xsi:type="string">1</argument> </arguments>

Don't know how to fix it because this function never get's called:
Magento\Catalog\Helper\Category->getStoreCategories() which has the check for the 'catalog/navigation/max_depth' setting.

@amansilla
Copy link

amansilla commented Dec 19, 2016

Same error here using Magento EE 2.1.3. @PascalBrouwers solutions doesn't seems to work for me.

@philipvandebriel
Copy link

Same in 2.1.4

@ventouris
Copy link

Do we have any news on this? I am on 2.1.6 and I still have the problem.

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: Catalog Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Sep 11, 2017
@magento-engcom-team
Copy link
Contributor

@ovsokolov, thank you for your report.
We've created internal ticket(s) MAGETWO-61422 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.2.x Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 11, 2017
@linden2015
Copy link

@magento-engcom-team , can you tell me what will be done with this issue?

  • Will it be fixed in 2.1.? What is the timeline?
  • Will it be fixed in 2.2.? What is the timeline?

@MarkSyred
Copy link

Issue remains in Magento 2.2.
@PascalBrouwers Where do you set the block argument you mention as a fix for this problem?

@magento-team
Copy link
Contributor

Hi @ovsokolov. Thank you for your report.
The issue has been fixed in #12640 by @arnoudhgz in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming patch release.

@magento-team magento-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jan 9, 2018
@ghost ghost self-assigned this Nov 14, 2018
@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-nazar. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@ghost
Copy link

ghost commented Nov 14, 2018

Hi @ovsokolov The issue was re-tested and we can confirm that it was fixed on the 2.3 release branch. We closing this issue as fixed due to upcoming 2.3 release that will be available soon.

@ghost ghost closed this as completed Nov 14, 2018
@Floddy
Copy link

Floddy commented Feb 1, 2019

While this has been fixed in 2.3, the fix doesn't seem correct. The level setting is applied as-is, so if you enter '1' as maximal depth, it filters on level 1, which is the root category, which is never shown, so to get the 'top categories' or any categories at all really, you have to enter 2 in the setting.

In M1 the level filter was applied as 'settingvalue + 1'.

@arnoudhgz
Copy link
Contributor

@Floddy it is according to the documentation. So people who use the documentation are not being confused with what programmers think: https://docs.magento.com/m2/ce/user_guide/catalog/navigation-top.html

@Floddy
Copy link

Floddy commented Feb 1, 2019

@arnoudhgz The documentation doesn't explicitly state the correlation between level and depth, and the setting says 'Maximal Depth', not 'Maximum level'. In my opinion they're two different things. Depth for me is 'how deep the main menu should render' - and setting it to 1 to me means 'render one level', just like in M1.

It also states that 'To limit the number of subcategories that appear in the top navigation, enter the number in the Maximal Depth field.' which could suggest entering 1 would show 1 set of subcategories.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Catalog Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests