This topic has 2 replies, 2 voices, and was last updated 8 years by McNitefly.

  • Author
  • #94502
     McNitefly
    Participant

    Dear Kleo Support,

    I’m having an issue with the WooCommerce product pictures on Single Product Pages.

    I cannot chose another picture from the choice of images below the big product picture. I can scroll through the list of pics – but I cannot click an image to be shown big.

    The problem appeared with the update to WP 4.4.

    I have also created a staging copy of the installation, where I have deactivated all plugins but Woocommerce. The problem persists.

    I also notice that the preview thumbs below the big product picture are greyed out. It has been like that before the update to 4.4, already, but there I was able to click and choose them. Do you have an idea where this greying out comes from?

    Could you please have a look if you can find the reason for the error?

    Thanks a lot for your help,

    Tom

    #94549
     sharmstr
    Moderator

    The choosing thumbnail issue has already been fixed and will be available in the next update. Until then, do the following to fix.

    Add the following function to the very bottom of /kleo/kleo-framework/lib/function-core.php

    COPY CODE
    
    if ( ! function_exists( 'sq_remove_img_srcset' ) ) {
    
    	function sq_remove_img_srcset( $attr ) {
    		if (! empty($attr)) {
    			unset($attr['srcset']);
    			unset($attr['sizes']);
    		}
    
    		return $attr;
    	}
    
    }
    

    In /kleo/woocommerce/single-product/product-image.php replace the following lines

    COPY CODE
    
    $image_title 		= esc_attr( get_the_title( get_post_thumbnail_id() ) );
    			$image_link  		= wp_get_attachment_url( get_post_thumbnail_id() );
    			$image       		= get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ), array(
    				'title' => $image_title
    				) );
    			$attachment_count   = count( $product->get_gallery_attachment_ids() );
    

    with this

    COPY CODE
    
    $image_title 		= esc_attr( get_the_title( get_post_thumbnail_id() ) );
    			$image_link  		= wp_get_attachment_url( get_post_thumbnail_id() );
    
    			add_filter( 'wp_get_attachment_image_attributes', 'sq_remove_img_srcset');
    
    			$image       		= get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ), array(
    				'title' => $image_title
    				) );
    
    			remove_filter( 'wp_get_attachment_image_attributes', 'sq_remove_img_srcset');
    
    			$attachment_count   = count( $product->get_gallery_attachment_ids() );
    

    I’m not seeing greyed out thumbnails on your site. Once the carousel finishes loading, the images look fine.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #94934
     McNitefly
    Participant

    Ah, perfect, thank you very much.

    Good to know that it’s already fixed, and your workaround also works like a charm.

    Thank you very much,

    kind regards,
    Tom

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?