WordPress.org

Forums

WooCommerce Menu Cart
[resolved] Empty Menu Error (4 posts)

  1. Joshua David Nelson
    Member
    Posted 1 year ago #

    I just installed this plugin prior to creating a menu, threw up all sorts of errors. Here was the fix, at line 323 in wcmenucart-settings.php:

    /**
    	 * Get menu array.
    	 *
    	 * @return array menu slug => menu name
    	 */
    	public function get_menu_array() {
    		$menus = get_terms( 'nav_menu', array( 'hide_empty' => false ) );
    		$menu_list = array(); // ----- Added this line
    		foreach ( $menus as $menu ) {
    			$menu_list[$menu->slug] = $menu->name;
    		}
    
    		return $menu_list;
    	}

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

  2. Jeremiah
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Joshua,

    Thanks for the note! We have that fix in our pro version but haven't gotten around to it for our free version yet as it's not too common. I've put it on our to-do list for the next update, however. Let us know if you need anything!

    Jeremiah

  3. Joshua David Nelson
    Member
    Posted 1 year ago #

    Jeremiah,

    Thanks. I found another one, actually. I swear I'm not hunting for them!

    I changed my settings to have it from a visible cart when empty, to not visible when empty. I got an error, the fix was to add a if statement on line 136 of woocommerce-menu-cart.php:

    if( !empty( $menu_item ) ) // ---- Added this
    			return $menu_item;

    Obviously the alternative could be to declare the variable first before the if statements, similar to the issue my original post.
    Cheers,
    Joshua

  4. Jeremiah
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Joshua,

    Thanks again, and don't feel like you're bothering us! We appreciate feedback from code aware users like yourself. If you have any more feedback feel free to let us know!

    Jeremiah

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce Menu Cart
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.