Support » Plugin: WooCommerce Menu Cart » Empty Menu Error

  • Resolved Joshua David Nelson


    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;

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeremiah


    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!



    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.

    Plugin Author Jeremiah


    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!


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Empty Menu Error’ is closed to new replies.