search ]

Show WooCommerce Checkout When Cart Is Empty

By default, there is an automatic redirect from the WooCommerce checkout page to the (empty) cart page when there are no products in the cart.

Try accessing the checkout page (link in footer) at this sample store and you will see the redirect.

There are uncommon situations where you may want to disable this redirect and show the user the checkout page anyway. You can do this by adding the following code to your functions.php file:

add_filter( 'woocommerce_checkout_redirect_empty_cart', '__return_false' );
add_filter( 'woocommerce_checkout_update_order_review_expired', '__return_false' );
Join the Discussion
0 Comments  ]

Leave a Comment

To add code, use the buttons below. For instance, click the PHP button to insert PHP code within the shortcode. If you notice any typos, please let us know!

Savvy WordPress Development official logo