If you need to show the category image of a product t the product page this is the shortcode.
Put this on functions.php and add the shortcode [category_image] where you want to be shown
function woocommerce_category_image() {
if ( is_product() ){
global $wp_query;
$terms_post = get_the_terms( $post->cat_ID , ‘product_cat’ );
foreach ($terms_post as $term_cat) {
$term_cat_id = $term_cat->term_id;
//echo $term_cat_id; this for debug to show the category id
}
$cat = $term_cat_id;
$thumbnail_id = get_woocommerce_term_meta($cat, ‘thumbnail_id’, true );
$image = wp_get_attachment_url( $thumbnail_id );
$content = the_title( ‘<p>’, ‘</p>’, FALSE ) . $content;
if ( $image ) {
echo ‘<div class=”shopimage”><img src=”‘ . $image . ‘” alt=”‘ . $cat->name . ‘” /></div>’;
}
}
}
add_shortcode(‘category_image’, ‘woocommerce_category_image’);