• Resolved bullard

    (@bullard)


    I have installed the free version of Menu Cart, and activatied the cart in main menu. But there is a dott infront of cart-icon. Is it possible to remove this?

    • This topic was modified 6 years, 10 months ago by bullard.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! I just checked your site but don’t see the bullet anymore. Did you find a fix yourself?

    Technical explanation of the issue:
    Looking at the page source, it does appear that your theme does not properly integrate the wordpress menu function wp_nav_menu. Our plugin uses the filter wp_nav_menu_{$menu->slug}_items to add a menu item (<li>) to the menu, which is normally wrapped in a <ul>. But in your theme, the wrapper has been exchanged with a <div> and the items have been rewrapped in a separate <ul>. Because of this, the Menu Cart <li> becomes orphaned:

    
    <div class="uk-navbar-right">
    	<ul class="uk-navbar-nav">
    		<li>Om</li>
    		<li>Produkter</li>
    		<li>Let’s Talk</li>
    		<li>Journal</li>
    		<li>Butikk</li>
    	</ul>
    	<li>1 produkt</li>
    </div>
    

    As you can see, the menu cart item is not actually part of the menu (<ul>).
    Ultimately this is a theme issue. You could either ask the theme developers to fix this (I think they can do this by using the items_wrap argument of wp_nav_menu(), but don’t know the details of their implementation so could be off the mark).
    Or you can fix/hack this by moving the item to the correct parent with jQuery. Here’s a way to add that to your site with an action hook:

    
    add_action( 'wp_footer', 'wpo_menucart_move_item' );
    function wpo_menucart_move_item() {
    	?>
    	<script type="text/javascript">
    	jQuery( function( $ ) {
    		$('.uk-navbar-nav').each( function() {
    			$menu = $(this);
    			$menu.parent().find('li.wpmenucartli').appendTo($menu);
    		});
    	});
    	</script>
    	<?php
    }
    

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters.

    I do recommend also informing the Yootheme developers about this issue because a theme fix would be preferable to the script above.

    Hope that helps!
    Ewout

Viewing 1 replies (of 1 total)
  • The topic ‘Dott infornt of cart in menu’ is closed to new replies.