Editing Header woo commerce headline

Hi !
I’d like to edit the “0 items 0,00 €” in my menu
and i just don’t seem to find the correct file, either it’s in the theme or woo commerce folder.

If you can guide me trough this, it’ll be very helpful.

Thanks a lot,

Picxou

Hi Picxou,

I hope you are well today and thank you for your question.

Are you talking about the cart displayed in the navigation menu as shown in the attached screenshot?

If yes then you can edit it by using the attached small plugin that contains the following custom code which you can edit however you want.


function remove_unite_woocommerce_menucart(){

    remove_filter('wp_nav_menu_items','unite_woocommerce_menucart' );
}
add_action('init', 'remove_unite_woocommerce_menucart');

/**
 * Place a cart icon with number of items and total cost in the menu bar.
 *
 * https://gist.github.com/srikat/8264387#file-functions-php
 */

function custom_unite_woocommerce_menucart($menu, $args) {

  // Check if WooCommerce is active and add a new item to a menu assigned to Primary Navigation Menu location
  if ( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || 'primary' !== $args->theme_location )
    return $menu;

  ob_start();
    global $woocommerce;
    $viewing_cart = __('View your shopping cart', 'unite');
    $start_shopping = __('Start shopping', 'unite');
    $cart_url = $woocommerce->cart->get_cart_url();
    $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );
    $cart_contents_count = $woocommerce->cart->cart_contents_count;
    $cart_contents = sprintf(_n('%d item', '%d items', $cart_contents_count, 'unite'), $cart_contents_count);
    $cart_total = $woocommerce->cart->get_cart_total();
    // Uncomment the line below to hide nav menu cart item when there are no items in the cart
    // if ( $cart_contents_count > 0 ) {
      if ($cart_contents_count == 0) {
        $menu_item = '</ul><ul class="nav navbar-nav navbar-right"><li><a class="woomenucart-menu-item" href="'. $shop_page_url .'" title="'. $start_shopping .'">';
      } else {
        $menu_item = '</ul><ul class="nav navbar-nav navbar-right"><li><a class="woomenucart-menu-item" href="'. $cart_url .'" title="'. $viewing_cart .'">';
      }

      $menu_item .= '<i class="fa fa-shopping-cart"></i> ';

      $menu_item .= $cart_contents.' - '. $cart_total;
      $menu_item .= '</a></li></ul>';
    // Uncomment the line below to hide nav menu cart item when there are no items in the cart
    // }
    echo $menu_item;
  $social = ob_get_clean();
  return $menu . $social;

}
add_filter('wp_nav_menu_items','custom_unite_woocommerce_menucart', 99, 2);

Best Regards,
Movin