Website Building » WooCommerce » How Do I Hide the Cart in WooCommerce?

How Do I Hide the Cart in WooCommerce?

Last updated on October 1, 2022 @ 7:29 pm

There are a few ways to hide the cart in WooCommerce. One way is to simply remove the cart icon from the header. This can be done by going to Appearance > Menus and unchecking the “Display Cart” box.

Another way to hide the cart is to disable the AJAX functionality that adds items to the cart. This can be done by going to WooCommerce > Settings > General and unchecking the “Enable AJAX add to cart buttons on products” box.

PRO TIP: If you are considering hiding the cart in WooCommerce, be aware that this may impact your sales negatively. Hidden carts can make it difficult for customers to know how much they have in their cart, or to find the cart page when they are ready to check out. This can lead to abandoned carts and lost sales.

Finally, you can also hide the cart completely by adding a bit of code to your theme’s functions.php file. Here is the code you would need to add:

function my_hide_cart() {
global $woocommerce;
$woocommerce->cart->empty_cart(); }
add_action( ‘wp_footer’, ‘my_hide_cart’ );

This will make it so that the cart is completely hidden on your site. However, please note that this code will also prevent anyone from actually adding items to their cart. So if you want to use this method, you will need to find another way to allow people to add items to their cart (such as a custom form).

Morgan Bash

Morgan Bash

Technology enthusiast and Co-Founder of Women Coders SF.