WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce Menu Cart
[resolved] Sub menu items don't show until something is in the cart (7 posts)

  1. tombsc
    Member
    Posted 9 months ago #

    Hi,

    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.
    Thanks

    http://wordpress.org/extend/plugins/woocommerce-menu-bar-cart/

  2. Ewout
    Member
    Plugin Author

    Posted 9 months ago #

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

    Ewout

  3. tombsc
    Member
    Posted 9 months ago #

    Thanks, the site is labotanica.com.au and the password is alycia

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

  4. Ewout
    Member
    Plugin Author

    Posted 9 months ago #

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

    If you want, you can email an admin login to support@wpovernight.com

  5. tombsc
    Member
    Posted 9 months ago #

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

  6. Ewout
    Member
    Plugin Author

    Posted 9 months ago #

    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!

  7. tombsc
    Member
    Posted 9 months ago #

    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.
    Tom

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.