title: Woocommerce: Show all products excluding what contains cart
body: <p>I'm trying to display all available products excluding what currently is in the cart. I have try to use some methods found over the internet but most of them use filters so I'm not able to exclude what contains cart.</p>
  
  <p>My example code to display all products in stock looks like:</p>
  
  <pre><code>    &lt;?php
      $params = array(
          'posts_per_page' =&gt; 999,
          'post_type' =&gt; 'product',
          'meta_query' =&gt; array(
              array(
                          'key' =&gt; '_stock_status',
                          'value' =&gt; 'instock'
                      )
          )
      );
  
      $wc_query = new WP_Query($params);
  
  ?&gt;
  
  &lt;ul&gt;
  &lt;?php
    if ($wc_query-&gt;have_posts()) :
      while ($wc_query-&gt;have_posts()) :
        $wc_query-&gt;the_post();
        $product = new WC_Product(get_the_ID());
  ?&gt;
    &lt;li&gt;
    &lt;h3&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
  &lt;?php
      the_post_thumbnail();
      the_excerpt();
      echo $product-&gt;get_price_html();
      echo $product-&gt;get_sku();
  ?&gt;
    &lt;/li&gt;
  
  &lt;?php
      endwhile; 
  
    wp_reset_postdata(); ?&gt;
    else:
  ?&gt;
    &lt;li&gt;
    &lt;?php _e( 'No Products' ); ?&gt;
    &lt;/li&gt;
  
    &lt;?php endif; ?&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Any tips how to get it to work? Only one thing comes to my mind - to check against SKUs from the cart.</p>