title: Check if cart is NOT empty in Woocommerce 3
body: <p>I can' figure this out, how to check if cart is empty. What am I doing wrong?</p>
  <p>My code:</p>
  <pre><code>add_action( 'wp_footer', 'redirecionar' );
  function redirecionar(){
      global $woocommerce;
      if ( is_page('carrinho-de-compras') and !sizeof($woocommerce-&gt;cart-&gt;cart_contents) ) {
         // do something
      }
  }    
  </code></pre>
  <p>OR</p>
  <pre><code>add_action( 'wp_footer', 'vazio' );
      function vazio() {
          if ( ! WC()-&gt;cart-&gt;get_cart_contents_count() == 0 ) { 
             // do something
          }
  }
  </code></pre>
  <hr />
  <h3>Solved</h3>
  <pre><code>&lt;?php add_action( 'wp_footer', 'vazio' );
      function vazio() {
          if ( ! WC()-&gt;cart-&gt;is_empty() ) { ?&gt;
          &lt;div style=&quot;width: 20%;&quot; class=&quot;footer-section &lt;?php echo esc_html($woo);?&gt;&quot;&gt;
              &lt;a href=&quot;&lt;?php echo 'https://my_web_page.pt/finalizar-compra';?&gt;&quot; title=&quot;Finalizar Compra&quot;&gt;&lt;i class=&quot;fa fa-credit-card&quot;&gt;&lt;/i&gt;&lt;/a&gt;
          &lt;/div&gt;
      &lt;?php   }
      } ?&gt;
  </code></pre>