Do you want to fix the common error in WooCommerce – checkout is not available whilst your cart is empty WooCommerce? In this post, we will demonstrate how you can get rid of this error/notice and help you fix it once and for all.
You will be required to understand how to add a code snippet to your WooCommerce theme or if you are a WooCommerce developer, you can use this code in your WooCommerce plugin.
First, we need to understand how this notice occurs so that we can figure out how to get rid of this notice if we come across it in the WooCommerce store
Table of Contents
Checkout Is Not Available Whilst Your Cart Is Empty WooCommerce
This is a default WooCommerce notice that appears when we try to access the checkout page and the cart does not have the products or items added.
The notice is a default WooCommerce notice that we can remove as you will see in the section below.
The checkout is not available whilst your cart is empty WooCommerce notice will appear as shown in the image below :
To get rid of this notice we simply need to use a filter that removes the WooCommerce default notices. In this case, the filter that we will use is the one share below :
add_filter( 'woocommerce_checkout_redirect_empty_cart', '__return_false' );
As you can see in the action filter above we are returning a false to get rid of the notice since it is set to true by default. To remove checkout is not available whilst your cart is empty WooCommerce notice, you should simply add this to your WooCommerce theme functions.php file or your plugin file.
As you can see I have added this action filter to the functions.php file and the notice has disappeared in the image below :
Change Checkout Is Not Available Whilst Your Cart Is Empty WooCommerce
You can customize the checkout is not available whilst your cart is empty WooCommerce to display your custom message and you can achieve this using the code snippet below :
[php]
function njengah_customize_woocommerce_checkout_notice( $custom_message ) {
$custom_message = ‘Some cool custom message here ….’;
return $custom_message ;
}
add_filter( ‘woocommerce_add_notice’, ‘njengah_customize_woocommerce_checkout_notice’, 10, 1 );
[/php]
Conclusion
In this post, we have looked at how to get rid of checkout is not available whilst your cart is empty WooCommerce notice and also how you can customize it to a custom message.

Joe is an experienced full-stack web developer with a decade of industry experience in the LAMP & MERN stacks, WordPress, WooCommerce, and JavaScript – (diverse portfolio). He has a passion for creating elegant and user-friendly solutions and thrives in collaborative environments. In his spare time, he enjoys exploring new tech trends, tinkering with new tools, and contributing to open-source projects. You can hire me here for your next project.
More articles written by Joe
Similar Articles
- How to Add View Cart Button In WooCommerce
- How to Add WordPress Customizer Setting WooCommerce
- How to Show Regular and Sale Price WooCommerce
- How to Add WooCommerce Shopping Cart Icon In Menu
- WooCommerce Visual Hook Guide Checkout
- How to Change Coupon Code Placeholder WooCommerce
- How to Check If It Is Checkout Page WooCommerce
- How to Set WooCommerce Different Sidebar For Each Category
- How to Change Out Of Stock Text in WooCommerce
- How To Edit WooCommerce Checkout Page
- How to Remove Email Footer Text ‘Built With WooCommerce’
- WooCommerce Extra Charges To WooCommerce Checkout
- How to Redirect User If Not Logged in WordPress » Page Redirect
- How to Change WooCommerce Checkout Error Messages
- How to Make a Child Page In WordPress
- How to Move Email Field to the Top WooCommerce
- How to Keep WooCommerce Description Tab Open by Default
- How to Insert Default Content to WordPress Post Editor Dynamically