<?php
$prod_cat_args = array(
'taxonomy' => 'product_cat',
'orderby' => 'id',
'hide_empty' => false,
'parent' => 0
);
$woo_categories = get_categories( $prod_cat_args );
foreach ( $woo_categories as $woo_cat ) {
$woo_cat_id = $woo_cat->term_id;
$woo_cat_name = $woo_cat->name;
$woo_cat_slug = $woo_cat->slug;
$category_thumbnail_id = get_woocommerce_term_meta($woo_cat_id, 'thumbnail_id', true);
$thumbnail_image_url = wp_get_attachment_url($category_thumbnail_id);
?>
<a href="<?php echo get_term_link( $woo_cat_id, 'product_cat' )?>" class="categories-wrap__item">
<img src="<?php echo $thumbnail_image_url ?>" alt="">
<h4><?php echo $woo_cat_name ?></h4>
</a>
<?php }
?>