displaying category image in woocommerce


</pre>
/* displaying category images */
 $all_categories = get_categories('taxonomy=product_cat&hide_empty=0&hierarchical=1');
 foreach ($all_categories as $cat) {
 $category = $cat->term_id; // retreives the currently queried object
 $category_thumbnail = get_woocommerce_term_meta($cat->term_id, 'thumbnail_id', true);
 $image = wp_get_attachment_url($category_thumbnail);
 echo '<a href="'.get_term_link($cat->slug, 'product_cat').'"><img src="'.$image.'" width="350" height="150"
 alt="category-image"></a>';
 }
<pre>