Viewing 7 replies - 1 through 7 (of 7 total)
  • I’m curious on this as well, if anyone could shed some light?

    I can’t get any images to show on category widget or category product page. The Categories are set up with a thumbnail but nothing appears

    I’d really like a resolution for this as well. I can’t get them to show up in the widget.

    I’d like to see this functionality as well. Any clues?

    I am trying to figure this out too. Can anyone help??

    Sorry to revive an oldish thread, but has anyone managed to solve this? Is there a plugin that would do this job? TIA

    I have found a way to solve this issue – though it means editing a core file. I am hoping to create a hook/filter to do the same soon.

    Basically look for:
    plugins/woocommerce/classes/walkers/class-product-cat-list-walker.php

    Then on line 62:

    function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
    
    	    $thumbnail_id = get_woocommerce_term_meta( $object->term_id, 'thumbnail_id', true ); // get category thumbnail id
    	    $image = wp_get_attachment_url( $thumbnail_id ); // get image and convert to var
    
    		$output .= '<li class="cat-item cat-item-' . $object->term_id;
    
    		if ( $args['current_category'] == $object->term_id )
    			$output .= ' current-cat';
    
    		if ( $args['current_category_ancestors'] && $args['current_category'] && in_array( $object->term_id, $args['current_category_ancestors'] ) )
    			$output .= ' current-cat-parent';
    
    		$output .=  '"><a href="' . get_term_link( (int) $object->term_id, 'product_cat' ) . '">' . __( $object->name, 'woocommerce' ) . '<img src="' . $image . '" alt="" /></a>'; // insert category image into link
    
    		if ( $args['show_count'] )
    			$output .= ' <span class="count">(' . $object->count . ')</span>';
    
    	}

    Hope this helps.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Category images not showing in product category widget’ is closed to new replies.