title: Get Products in Category WordPress
body: <p>I'm trying to pull all products located within a certain category slug.</p>
  
  <p>I've tried the following, however both return every product in the store.</p>
  
  <pre><code>$products = wc_get_products( array( 'category' =&gt; array( 'Sony' ) ));
  </code></pre>
  
  <p>and </p>
  
  <pre><code>$productlist = wp_query(array( 'post_type' =&gt; 'product', 'product_cat' =&gt; 'Sony'));
  </code></pre>
  
  <p>Any pointers would be much appreciated.</p>