title: Get products which are visible in catalog in a WP_query on Woocommerce
body: <p>I'm currently trying to get all products in a category page which are visible in catalog. I've tried this here but I'm getting no products with this query:</p>
  
  <pre><code>$args = array(
      'post_type'   =&gt; 'product',
      'product_cat' =&gt; get_queried_object()-&gt;slug,
      'meta_query'  =&gt; array(
          array(
              'key'     =&gt; '_visibility',
              'value'   =&gt; array( 'catalog', 'visible' ),
              'compare' =&gt; 'IN',
          )
      )
  );
  $loop = new WP_Query( $args );
  
  var_dump( $loop );
  </code></pre>
  
  <p>When I remove the <code>meta_query</code> visibility part I'm getting all products including the hidden ones but I just need the visible ones. Whats wrong here?</p>