Support » Plugin: WooCommerce Menu Cart » Sub menu items don't show until something is in the cart

  • Resolved tombsc



    If I set the menu bar cart to show only when there is something in the cart (my preference), my sub menu pages don’t show up. When there is something in the cart, the sub menu items show up.
    Also, if I set the menu bar cart to be always displayed, the sub menu pages do display.

    By sub menu I mean child pages of a page in the menu that usually show up when hovering over the page in the menu.

    Hope that makes sense.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Ewout


    Hi Tom,
    That is certainly odd behavior. Do you have a link to your site so we can check it out?


    Thanks, the site is and the password is alycia

    If you like I can email you an admin sign in?

    Plugin Author Ewout


    Just to confirm, does the submenu work with the menu cart disabled?

    If you want, you can email an admin login to

    Yes it does work when the plugin is disabled. Ill send you a log in

    Plugin Author Ewout


    Ok, that was a nasty bug!

    The technical bit: Your theme has a piece of javascript (selectnav.js) that requires a menu item to contain some sort of HTML. To be able to create this menu item on the fly (AJAX), we need a menu item to be in place before anything is added to the cart. But it’s emty, so selectnav.js hangs (it threw an error too).

    I slightly modified the plugin code: at the end of the public function wcmenucart_menu_item(), just before return $menu_item; i added the following bit:

    else {
    	$menu_item = '<a class="wcmenucart-contents" href="#"></a>';

    This creates HTML for selectnav.js to process (it doesn’t do anything with it though), so now everything works like it should.

    Let us know if you have any other issues!

    Absolutely fantastic support! Thanks so much for your help.

    Feel free to log back in and fix the issues I’m having integrating woocommerce into my theme 😉

    Seriously though, best support ever – very much appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Sub menu items don't show until something is in the cart’ is closed to new replies.