Get Third Level Categories WooCommerce

I am Trying To get Third Level WooCommerce Categories Here Is My Code:

$args = array(
        'hierarchical' => 1,
        'show_option_none' => '',
        'hide_empty' => 0,
        'parent' =>18,
        'taxonomy' => 'product_cat'
    );
    $subcats = get_categories($args);
    echo '<div class="wooc_sclist">';
    foreach ($subcats as $sc) {
        $link = get_term_link($sc->slug, $sc->taxonomy);
        echo '<ul><a href="' . $link . '">' . $sc->name . '</a></ul>';
    }
    echo '</div>';
    wp_reset_query();

Read more here: Get Third Level Categories WooCommerce

Leave a Reply

Your email address will not be published. Required fields are marked *