11

I am new to Magento so please bear with me :D

I have successfully created a theme that is a child to the blank theme.

I am trying to get the menu working and for the life of me cannot see why it is not showing. I have read a couple of other threads and no luck.

I have added a root category with my subcategories in it. I have then assigned it to the store settings. I have re-indexed the site, cleared cache and still no joy.

Am I doing the right thing by just adding a category and it will show?

Thanks

It seems I don't have the default category - see screenshot below

enter image description here

UPDATE

I have reinstalled Magento on my local machine. The menu shows fine on Luma and Blank theme but on my own custom one, it is not showing. Is there anything I need to include or check?

Thanks for the help

  • Does the menu work on blank or Luma theme ? – Devtype Jan 11 '17 at 16:08
  • Didn't try that. Just enabled the Luma theme and no it doesn't show. Any idea to why it is not showing? – Peter Wilkinson Jan 11 '17 at 16:26
17

Solution 1 :

You need to have all your categories UNDER the "Default Category". Then they should show.

enter image description here

Solution 2 :

Verify that Default Category Is Active (Enable category = "yes") and "Include in Navigation Menu" to Yes.

enter image description here

Clear your cache by running the php bin/magento cache:clean command and check it will works.

Update :

Just go to the Stores -> All Stores -> Click on Store (Main website store) - >You will see Root category option there listed with your category name -> select that one (Test,Collection whatever you want)->click on save and check.

Refer below screenshot :

enter image description here

enter image description here

  • Thanks for this. I have checked and seems that I dont have the "Default Caregory". I have however added the Collections or Test Category as the "category name" under your solution 2. I have also made sure that enable category and include in menu is active. See image that I have added in my question. Any ideas to why I dont have default category and do I need it, if so - how can I get it ? Thanks – Peter Wilkinson Jan 16 '17 at 12:17
  • Thanks for the help. I have tried that before but did it again to check and still no joy. I am so lost to why this is happening :( – Peter Wilkinson Jan 16 '17 at 17:05
  • 1
    I am such a loss here. I have done exactly what you said. Made sure I have a root category, make sure that enable and include in menu is checked. I then made sure that it is included under store information. Cleaned cache, tried even the Luma theme and still no joy. Do you know if I need to create or include a block in my theme, or check if it is in the Luma or Blank theme? I just dont know where to go from here. – Peter Wilkinson Jan 17 '17 at 9:00
  • Thanks. Did as you said and showing nothing still.. I just want to give up at this point :D – Peter Wilkinson Jan 17 '17 at 10:51
  • Thanks Dave for the help. I have done an update to my question - can you take a look? – Peter Wilkinson Jan 18 '17 at 9:20
3

If you have tried all the other solutions and checked all the other basic things (enabled, correct root category...) then I might have the solution for you!

If the category was every removed from the menu ("Include in Menu" = "Off" in admin), and then turned back on; it seems there is a bug in Magento 2 here. Magento 2 will only set the "include_in_menu" attribute to 1 for the admin store and not any other front end stores, it will leave them as 0. So Magento thinks they are still disabled from the menu.

The solution is easy:

  1. Figure out the attribute_id of the "include_in_menu" attribute; in my case, it's 69.
  2. Figure out the entity_id of the category that you are working with; in my case its 47.
  3. Look at the "catalog_category_entity_int" table for that category (entity_id) and attribute (attribute_id). Make sure "value"=1 for all the frontend stores. In my case store, 0 is an admin, and store 1 and 2 are two frontend stores.
  4. Reindex and flush cache

Hope this works for you. It took me an hour to recreate a category structure, then when it happened again I dug into the code and found this. If it does work for you, give this answer an upvote. We use Magento 2 on our GoToTags Store. The journey has been "fun" because of issues like this.

Good luck!

enter image description here

enter image description here

  • This was it in my case, to find the appropriate row to change value to 1 I used SELECT * FROM catalog_category_entity_int WHERE attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'include_in_menu') AND entity_id = 3 – Liam Mitchell Mar 27 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.