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 = '';
$empty_cart_notice .= wp_kses_post( apply_filters( 'wc_empty_cart_message', __( 'Your custom empty cart message here.', 'woocommerce' ) ) );
echo $empty_cart_notice . '
';
}