Skip to content
neve

Save hours, not minutes – launch faster with 110+ patterns, powerful pro tools, and priority support when it counts!

See Pro Plans →

How to Customize the Cart Dropdown Button Text in Neve

When using Neve's Cart Icon component in the Header / Footer Builder with the Dropdown or Off Canvas mini-cart style, WooCommerce displays a View Cart button inside the cart dropdown. Depending on your site language, this button may appear as a translated string such as Bekijk winkelwagen (Dutch).

There is no built-in option in Neve or WooCommerce to change this button label directly from the admin panel. However, you can override it using a PHP code snippet.

📝 Note: This approach works by overriding WooCommerce's internal translation strings using the gettext filter. It targets the exact translated text that appears on your site, so you need to know the string that WooCommerce is currently displaying.

Prerequisites

Before adding the snippet, confirm the following:

  • Neve Pro is active on your site.
  • The WooCommerce plugin is installed and activated.
  • The Cart Icon component is added to your header via the Header / Footer Builder.
  • The Mini Cart Style for the Cart Icon is set to Dropdown or Off Canvas.

For help setting up the Cart Icon component, see The Cart Icon Component - Neve Header / Footer Builder.

Identify the Button Text to Override

The View Cart button text inside the mini-cart is controlled by WooCommerce. When WooCommerce is translated into another language, the button displays the translated version of View cart.

For example:

  • English: View cart
  • Dutch: Bekijk winkelwagen
  • German: Warenkorb anzeigen

To confirm the exact string displayed on your site, hover over the cart icon on your front end and inspect the button text. You will need to use that exact text in the snippet below.

Add a Custom Code Snippet

The following PHP snippet uses the gettext filter to replace a specific WooCommerce string with your preferred text.

💡 Tip: Use the Insert PHP Code Snippet plugin to add this code without editing theme files. This keeps your customization safe across theme updates. Alternatively, add it to your child theme's functions.php file.

  1. Open Insert PHP > Add New Snippet in your WordPress dashboard (or open your child theme's functions.php).
  2. Paste the following snippet:
php
function customize_cart_strings( $translation, $text, $domain ) {
    if ( $domain === 'woocommerce' ) {
        switch ( $text ) {
            case 'Bekijk winkelwagen':
                $translation = 'Winkelwagen';
                break;
        }
    }
    return $translation;
}
add_filter( 'gettext', 'customize_cart_strings', 20, 3 );
  1. Replace 'Bekijk winkelwagen' with the exact button text currently displayed on your site.
  2. Replace 'Winkelwagen' with the text you want to display instead.
  3. Save and activate the snippet.

⚠️ Important: The case value must match the translated string exactly, including capitalization. If the text does not match, the override will not apply.

You can add more case entries inside the switch block to override additional WooCommerce strings at the same time.

Verify the Change

  1. Open your site in a browser and navigate to any page where the cart icon is visible in the header.
  2. Add a product to your cart to trigger the mini-cart dropdown.
  3. Confirm that the cart button now displays the text you specified.

💡 Tip: If the button text has not changed, try clearing your site cache and any browser cache, then reload the page.