title: How To Sub-Sub categories in Woocommerce mega menu like: Category>Sub category>Sub sub category
body: <p>How To Sub-Sub categories in Woocommerce mega menu  like: Category&gt;Sub category&gt;Sub sub category</p>
  <p>I use in header file this codes:</p>
  <pre><code>&lt;?php
  </code></pre>
  <p>$button_type = isset( $args['button_type'] ) ? $args['button_type'] : 'button';</p>
  <p>$categories_data = WsclWoocommerce::get_nav_shop_categories();
  if ( $categories_data ) {
  $menu_title = get_theme_mod( 'header_store_menu_title', Helper::get_default_theme_data( 'header_store_menu_label' ) );
  ?&gt;
  
  
  
  
  
  
  
  
  
  
  
  
  
  &lt;?php
  foreach ( $categories_data as $categories_data_item ) {
  if ( ! isset( $categories_data_item['term_name'] ) ) {
  continue;
  }</p>
  <pre><code>                $li_class = '';
                  if ( $categories_data_item['children'] ) {
                      $li_class = 'class=&quot;with-arrow&quot;';
                  }
  
                  if ( $categories_data_item['term_link'] ) {
                      $tag_open  = '&lt;a href=&quot;' . $categories_data_item['term_link'] . '&quot;&gt;';
                      $tag_close = '&lt;/a&gt;';
                  }
                  else {
                      $tag_open  = '&lt;span&gt;';
                      $tag_close = '&lt;/span&gt;';
                  }
                  ?&gt;
                  &lt;li &lt;?php echo $li_class; ?&gt;&gt;
                      &lt;?php echo $tag_open; ?&gt;
                      &lt;?php echo $categories_data_item['term_img']; ?&gt;
                      &lt;span&gt;&lt;?php echo $categories_data_item['term_name']; ?&gt;&lt;/span&gt;
                      &lt;?php echo $tag_close; ?&gt;
                      &lt;?php if ( $categories_data_item['children'] ) { ?&gt;
                          &lt;button class=&quot;arrow&quot;&gt;
                              &lt;svg class=&quot;icon-arrow-bottom&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; aria-hidden=&quot;true&quot; focusable=&quot;false&quot; width=&quot;1em&quot; height=&quot;1em&quot; style=&quot;-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);&quot; preserveaspectratio=&quot;xMidYMid meet&quot; viewbox=&quot;0 0 32 32&quot;&gt;
                                  &lt;g fill=&quot;none&quot; stroke=&quot;#626262&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; stroke-width=&quot;4&quot;&gt;
                                      &lt;path d=&quot;M30 12L16 24L2 12&quot;&gt;&lt;/path&gt;
                                  &lt;/g&gt;
                              &lt;/svg&gt;
                          &lt;/button&gt;
                          &lt;div class=&quot;vertical-submenu&quot;&gt;
                              &lt;div class=&quot;vertical-submenu-wrap&quot;&gt;
                                  &lt;button class=&quot;btn-close&quot; type=&quot;button&quot;&gt;
                                      &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; aria-hidden=&quot;true&quot; focusable=&quot;false&quot; width=&quot;1em&quot; height=&quot;1em&quot; style=&quot;-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);&quot; preserveaspectratio=&quot;xMidYMid meet&quot; viewbox=&quot;0 0 24 24&quot;&gt;
                                          &lt;path fill=&quot;#626262&quot; d=&quot;M13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29l-4.3 4.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l4.29-4.3l4.29 4.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42z&quot;&gt;&lt;/path&gt;
                                      &lt;/svg&gt;
                                  &lt;/button&gt;
                                  &lt;?php foreach ( $categories_data_item['children'] as $child_item ) {
                                      if ( $child_item['term_link'] ) {
                                          $tag_open  = '&lt;a href=&quot;' . $child_item['term_link'] . '&quot;&gt;';
                                          $tag_close = '&lt;/a&gt;';
                                      }
                                      else {
                                          $tag_open  = '&lt;span&gt;';
                                          $tag_close = '&lt;/span&gt;';
                                      }
                                      ?&gt;
                                      &lt;div&gt;
                                          &lt;p&gt;&lt;?php echo $tag_open; ?&gt;&lt;?php echo $child_item['term_name']; ?&gt;&lt;?php echo $tag_close; ?&gt;&lt;/p&gt;
                                          &lt;?php
                                          if ( isset( $child_item['children'] ) &amp;&amp; $child_item['children'] ) {
                                              echo '&lt;ul&gt;';
                                              foreach ( $child_item['children'] as $item ) {
                                                  if ( $item['term_link'] ) {
                                                      $tag_open  = '&lt;a href=&quot;' . $item['term_link'] . '&quot;&gt;';
                                                      $tag_close = '&lt;/a&gt;';
                                                  }
                                                  else {
                                                      $tag_open  = '&lt;span&gt;';
                                                      $tag_close = '&lt;/span&gt;';
                                                  }
  
                                                  echo '&lt;li&gt;' . $tag_open . $item['term_name'] . $tag_close . '&lt;/li&gt;';
                                              }
                                              echo '&lt;/ul&gt;';
                                          }
                                          ?&gt;
                                      &lt;/div&gt;
                                  &lt;?php } ?&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;?php } ?&gt;
                  &lt;/li&gt;
              &lt;?php } ?&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>