WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Change text of empty cart

[Resolved] Change text of empty cart

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

    @pomegranate

    Hello Mottersland,
    Can you explain what you mean by the “Empty Cart” text?

    Do you mean the “0 items – 0 NOK” text or the hover text “Start shopping”?

    Thanks!
    Ewout

    “0 items – 0 NOK” , if this could be changed into something else when the cart is empty?

    Plugin Author Ewout

    @pomegranate

    Hi Mottersland,
    This is currently not possible, but I think there shouldn’t be too much in the way of adding this. I’ll look into it and let you know soon!

    Ewout

    Hi Ewout.

    Is this implemented yet?

    Kind regards
    Bocage

    Plugin Author Ewout

    @pomegranate

    Hello Bocage,
    You can do this with a filter in your theme’s 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 ) {
    	if ($item_data['cart_contents_count'] == 0) {
    		$menu_item_a_content = '<span class="wpmenucart-empty-display">Go to webshop</span>';
    	}
    	return $menu_item_a_content;
    }

    Let me know if you have any other questions!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Change text of empty cart’ is closed to new replies.