Woocommerce products query - order_by
<p>I am using a query in my template.php file to display <code>wooCommerce</code> products by category.</p>

<p>My query looks like this:</p>

<pre><code>&lt;?php
   $args = array(
     'post_type' =&gt; 'product',
     'stock' =&gt; 1,
     'posts_per_page' =&gt; 99,
     'tax_query' =&gt; array(
          'relation' =&gt; 'OR',
           array(
              'taxonomy' =&gt; 'product_cat',
              'field' =&gt; 'slug',
              'terms' =&gt; 'system_components',
              'menu_order' =&gt; 'asc'
           ),
           array(
              'taxonomy' =&gt; 'product_cat',
              'field' =&gt; 'slug',
              'terms' =&gt; 'add-ons',
              'menu_order' =&gt; 'asc'
           )
      ),
      'meta_query' =&gt; array(
            array(
               'key'       =&gt; '_visibility',
               'value'     =&gt; 'hidden',
               'compare'   =&gt; '!='
      )
    ));


   $loop = new WP_Query($args);
   if ($loop-&gt;have_posts()) {
     while ($loop-&gt;have_posts()) :
          $loop-&gt;the_post(); ?&gt;
            .....
</code></pre>

<p>This works, and I can see the products I want and the one I don't want are not visible.</p>

<p>The only bit I don't understand is that <code>'menu_order' =&gt; 'ASC'</code> doesn't seem to work.</p>

<p>I doesn't' matter what I type as menu order in the product settings, the order doesn't change.</p>

<p>What am I doing wrong here?</p>

<p>Thanks</p>