Cart

WooCommerce Change “Your Cart Is Currently Empty” Text

WooCommerce Change “Your Cart Is Currently Empty” Text

Pre-Requisites

There are no pre-requisites in order for you to be able to implement this solution.

How To Implement This Solution?

Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.

About This Solution

This quick guide shows you how you can change the cart notice text which appears when you cart is empty, “Your cart is currently empty”. You’ll notice form the code snippet that the next new custom text you output is wrapped HTML which is the cart notice itself (the styled banner shown).

/**
 * Snippet Name:	WooCommerce Change Your Cart Is Currently Empty Text
 * Snippet Author:	ecommercehints.com
 */

remove_action( 'woocommerce_cart_is_empty', 'wc_empty_cart_message', 10 );	// Remove the current cart notice
add_action( 'woocommerce_cart_is_empty', 'ecommercehints_change_empty_cart_text', 10 );	// Create your new custom cart notice

function ecommercehints_change_empty_cart_text() {
    $empty_cart_notice  = '<p class="cart-empty woocommerce-info">';
    $empty_cart_notice .= wp_kses_post( apply_filters( 'wc_empty_cart_message', __( 'Your custom empty cart message here.', 'woocommerce' ) ) );
    echo $empty_cart_notice . '</p>';
}

Snippet Benefits

  • Tailor your empty cart messaging to improve the user experience.

100 WooCommerce Conversion Rate Optimisation Tips

This field is for validation purposes and should be left unchanged.

Let’s collaborate!

Need to outsource WordPress development?

Join forces with UnlimitedWP for an outsourced white label web development service you can truly rely on.

First Timer Here?

Sign up to receive 10% off on your first month with us.

26027
WELCOME OFFER