title: How to get the products by categories in woocommerce?
body: <p>I am trying to get all the products by categories to create a menu.</p>
  
  <p>The output should be like:</p>
  
  <pre><code>    name of category1
        product in category1
        product in category1
        product in category1
     name of  category2
        product in category2
        product in category2
        product in category2
  </code></pre>
  
  <p>For this I am using this code:</p>
  
  <pre><code>&lt;?php
                      $args = array(
                          'number' =&gt; $number,
                          'orderby' =&gt; $orderby,
                          'order' =&gt; $order,
                          'hide_empty' =&gt; $hide_empty,
                          'include' =&gt; $ids
                      );
  
                      $product_categories = get_terms('product_cat', $args);
  
                      ?&gt;
  </code></pre>
  
  <p>But do not how to get the result printed in that format mentioned above.</p>
  
  <p>I am new to woocommerce and wordpress. Please help me.</p>