Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1085040
    appliedimage
    Participant

    Hi

    I set up Woocommerce on my site and had to apply this fix for the thumbnail sizes:

    // Do Not Remove Woocommerce Plugin Settings
    // =============================================================================
    function x_woocommerce_donot_remove_plugin_setting(){
      if ( ! is_admin() ) {
        return;
      }
      remove_filter( 'woocommerce_product_settings', 'x_woocommerce_remove_plugin_settings', 10 );
    }
    add_action('init', 'x_woocommerce_donot_remove_plugin_setting');

    This had fixed the main product thumbnails however on my products with variables the thumbnail seems to appear stretched,

    How can i resolve this?

    Thanks X

    #1085042
    appliedimage
    Participant
    This reply has been marked as private.
    #1085336
    Darshana
    Moderator

    Hi there,

    Please try to install this plugin (https://wordpress.org/plugins/force-regenerate-thumbnails/) then regenerate your product images.

    Hope that helps.

    #1085464
    appliedimage
    Participant
    This reply has been marked as private.
    #1086217
    Rad
    Moderator

    Hi there,

    Weird, it’s displaying 400×400 image even though it was set to pull entry size (600×400). Please add this code to your child theme’s functions.php

    function x_woocommerce_modify_variable_image_size_600_400( $child_id, $instance, $variation ) {
    	$attachment_id = get_post_thumbnail_id( $variation->get_variation_id() );
    	$attachment = wp_get_attachment_image_src( $attachment_id, array( 600, 400 ) );
    	$image_src = $attachment ? current( $attachment) : '';
    	$child_id['image_src'] = $image_src;
    
    	return $child_id;
    }
    
    add_filter( 'woocommerce_available_variation', 'x_woocommerce_modify_variable_image_size_600_400', 99, 3);

    Hope this helps.

    #1086342
    appliedimage
    Participant

    Hi

    I’ve added the code supplied and its not fixed the problem?

    Thanks again

    #1086503
    Darshana
    Moderator

    Hi there,

    First of all, please try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

    If that is not the case, would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1092427
    appliedimage
    Participant
    This reply has been marked as private.
    #1092886
    Lely
    Moderator

    Hi There,

    Thank you for the credentials. See attached image. That might be because of that settings. It force the image to be 400×400. Try to adjust it. Your default image that is not stretch is 600×400. Then regenerate your thumbnails again.

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1085040 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>