Support » Plugin: WooCommerce » Woocommerce – OnHover Image Showing the first gallery image, not the featured

  • Hey guys, how are you?

    So, I have a wordpress site with Woocommerce.

    When I browse to a product category page (catalog), I have my products with the “On hover” enabled for the catalog images. The problem is, the image that loads with the page on the “thumbnail” is the first image on the galery, and the “On hover” image is the featured one. Is there a way to invert this?

    Some images:
    http://imgur.com/a/BVLQH

    Thanks!

    • This topic was modified 2 years, 4 months ago by  mobarreto.
    • This topic was modified 2 years, 4 months ago by  mobarreto.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Found out that this problem is in my theme, not the woocommerce in general.

    Thanks.

    Actually, the support for my theme told me that this is a Woocommerce problem, no the theme.

    I did find the code above in wp-content/plugins/woocommerce/includes/wc-template-functions.php

    function woocommerce_subcategory_thumbnail( $category ) {
    		$small_thumbnail_size  	= apply_filters( 'subcategory_archive_thumbnail_size', 'shop_catalog' );
    		$dimensions    			= wc_get_image_size( $small_thumbnail_size );
    		$thumbnail_id  			= get_woocommerce_term_meta( $category->term_id, 'thumbnail_id', true );
    
    		if ( $thumbnail_id ) {
    			$image        = wp_get_attachment_image_src( $thumbnail_id, $small_thumbnail_size );
    			$image        = $image[0];
    			$image_srcset = function_exists( 'wp_get_attachment_image_srcset' ) ? wp_get_attachment_image_srcset( $thumbnail_id, $small_thumbnail_size ) : false;
    			$image_sizes  = function_exists( 'wp_get_attachment_image_sizes' ) ? wp_get_attachment_image_sizes( $thumbnail_id, $small_thumbnail_size ) : false;
    		} else {
    			$image        = wc_placeholder_img_src();
    			$image_srcset = $image_sizes = false;
    		}

    There is more regarding product thumbnail in the woocommerce code.

    Any help?

    Any help?

    Anyone?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Woocommerce – OnHover Image Showing the first gallery image, not the featured’ is closed to new replies.