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.
WooCommerce Conversion Rate Optimisation (CRO) eBook
100 WooCommerce Conversion Rate Optimisation Tips

Leave a Reply

If you are going to write code in the comments, please wrap it between code tags.

Your email address will not be published. Required fields are marked *

Other Recent Guides

Subscribe To Emails

Get exclusive WooCommerce tips that I only share with email subscribers

Join hundreds of other subscribers