title: Displaying all products categories in a drop down menu
body: <p>Working with WP and WooCommerce product categories. I'm attempting to display all product categories in a drop down menu. I have this working, however I need the hierarchy to also be displayed. For example Apple is a Sub Category of Fruit. </p>
  
  <p>So I want the display to look like this:</p>
  
  <pre><code>Fruit    
  -Apple   
  -Pear
  </code></pre>
  
  <p>But it currently looks like this:</p>
  
  <pre><code> Fruit    
   Apple   
   Pear
  </code></pre>
  
  <p>My code currently looks like this:</p>
  
  <pre><code>$args = array(
              'number'     =&gt; $number,
              'orderby'    =&gt; $orderby,
              //'name' =&gt; 'select_name',
              //'id' =&gt; 'select_name',
              'order'      =&gt; $order,
              'hide_empty' =&gt; false,
              'include'    =&gt; $ids,
              'hierarchical' =&gt; true
              );
  
  $product_categories = get_terms( 'product_cat', $args );
  </code></pre>
  
  <p>My markup:</p>
  
  <pre><code>&lt;select name='categorylist'&gt;    
     &lt;?php foreach($product_categories as $cat) {
        echo "&lt;option value='{$cat-&gt;name}'&gt;{$cat-&gt;name}&lt;/option&gt;"; 
     } ?&gt;
  </code></pre>
  
  <p></p>
  
  <p>I know it is possible to set the hierarchy like this for sub categories. Could anyone suggest what I can do to my $args array to achieve this. Thanks </p>