jmccole83
11/7/2018 - 3:47 PM

WooCommerce | Test if cart is empty

Use the below snippet to test if a WooCommerce cart is empty.

if ( WC()->cart->get_cart_contents_count() != 0 ) {
  // cart is not empty
} else {
  // cart is empty
}