• Please help, can I hide menu item when sub menu is empty?

    I want to use mega menu with attribute filter widget, but attribute filter is empty when you are not on shop page or if in that shop page there are not products with that attribute.

    So I want to hide menu item if this product filter is empty.

    I use one fitler attribute per menu item, so if this attribute is empty the menu item is empty. I want to hide it

    Thans

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author megamenu

    (@megamenu)

    Hi atzimpourdakas,

    To do this you would need to view the page source of the shop page and check the body tag. It should have a unique ID on it, e.g. page-id-123. Then you can use this to target the menu item with CSS and hide it. E.g.

    body.page-id-123 li#mega-menu-item-456 {
        display: none !important;
    }

    That would hide menu item 456 on page 123.

    Regards,
    Tom

    • This reply was modified 3 years, 8 months ago by megamenu.
    Thread Starter atzimpourdakas

    (@atzimpourdakas)

    Hi ,

    Thanks for response and sorry for my english.

    I dont want to hide a specific menu item.
    I want menu item auto hides if its empty.

    Thank you

    Plugin Author megamenu

    (@megamenu)

    Hi atzimpourdakas,

    It is not possible to auto hide the items sorry. You would need to hide them manually based on the page ID.

    Regards,
    Tom

    Thread Starter atzimpourdakas

    (@atzimpourdakas)

    Thank you but I think its a good idea for a future update. Because some widgets like attribute product filter for example, are visible only when they are needed.
    So if I have selected filters in a mega menu, I dont need the menu item when filters are not visible.

    Thank very much for your time!

    Plugin Author megamenu

    (@megamenu)

    Hi atzimpourdakas,

    I understand, thanks for the suggestion!

    Regards,
    Tom

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hide menu item when sub menu is empty’ is closed to new replies.