Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi!
    The dash is added between the amount and price with CSS:

    .cartcontents + .amount:before {
    	content: '-';
    	margin: 0 0.25em;
    }

    This is either overriden by your theme (which you could fix by re-adding the styles/overriding theirs), or your theme is removing the spans from the menu item for the mobile menu (which would be much harder to fix).

    Let me know if you need more help with this!

    Ewout

    Thread Starter Jsmarty

    (@jsmarty)

    Thanks for the reply, i added the above into my style.css, it works for the normal full screen (laptop) menu but still does’t work for the mobile menu.

    Having a look at the source code for the menu, the link in the mobile menu only shows this code:

    <option value=”https://localhost:8888/kellie2/?page_id=27″>1 item£5.00</option>

    is that any help?

    cheers.

    Plugin Contributor Ewout

    (@pomegranate)

    I’m afraid that is bad news: it means your theme strips all the html from menu items and turns it into a flat option list.
    What you can do, is disable the CSS dash, and then hardcode it into the item.

    Disable CSS dash:

    .cartcontents + .amount:before {
    	content: '' !important;
    	margin: 0 !important;
    }

    hardcode the dash, add this to your theme functions/functions.php:

    add_filter( 'wpmenucart_menu_item_a_content', 'wpmenucart_empty_display_text', 10, 4 );
    function wpmenucart_empty_display_text ( $menu_item_a_content, $menu_item_icon, $cart_contents, $item_data ) {
    	// add dash between cartcontents & amount
    	$menu_item_a_content = str_replace('</span><span', '</span> - <span', $menu_item_a_content);
    	return $menu_item_a_content;
    }

    Hope that helps!

    Ewout

    Thread Starter Jsmarty

    (@jsmarty)

    hi,

    sorry for not replying sooner. Just tried the above code and it actually removed the ‘ – ‘ completely from all menus instead of adding it in.

    Cheers for the help.

    Plugin Contributor Ewout

    (@pomegranate)

    The CSS removes the dash, but the filter adds it to the HTML instead (I tested this on my own dev site). You may need to close & reopen the browser tab, to make sure you’re not looking at AJAX cache.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘0 Items£0.00 Showing In Mobile Menu – Change?’ is closed to new replies.