Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Nabil Lemsieh

    (@nlemsieh)

    Hello,

    I can see that you’re using Divi BodyCommerce plugin which forces full size instead of thumbnail image on the product pages. Adding this code under Appearance menu → Theme Editor → functions.php should fix the problem:

    add_filter('wp_get_attachment_image_src', function( $img, $id, $size ){
    
    	if( function_exists('is_product') && is_product() 
    		&& get_post_meta($id, '_processed_at', true) 
    		&& $size !== 'woocommerce_single' ){
    		$img = wp_get_attachment_image_src($id, 'woocommerce_single');
    	}
    
    	return $img;
    
    },10,3 );

    Best regards,
    Nabil

    • This reply was modified 3 years, 9 months ago by Nabil Lemsieh.

    Hey, I am facing the same problem on my website, even after regenerating the thumbnails the images shown are of different sizes. I Have cleared my cache but still no luck. link to my website is https://storelize.com

    • This reply was modified 3 years, 9 months ago by anshverma14.
    Plugin Author Nabil Lemsieh

    (@nlemsieh)

    Hello @anshverma14

    If you’re using the free plugin and have more than 150 images, you may still have some images that are not resized. To make sure the plugin is working for you try this:

    1. In the media library, regenerate thumbnails for a single image (screenshot)
    2. Clear cache
    3. Check out the product page to see if the image has been resized properly.

    Let me know if that doesn’t work and I’ll be happy to assist further.

    Best,
    Nabil

    It didn’t work for me either!
    I am using the wp-crowdfunding plugin, which creates crowdfunding campaigns as a Woocommerce product, that is, I believe there is no difference in the structure of Woocommerce and, therefore, the images of the campaigns will be the same as the products!
    I tried to create 3 products and the images are still different sizes!
    https://imgpile.com/images/7fnUl4.jpg

    Plugin Author Nabil Lemsieh

    (@nlemsieh)

    Hi @markk26

    Try switching to GD extension by adding this code to Appearance menu > Theme Editor > functions.php:

    add_filter('wp_sir_driver', function(){
    return 'gd';    
    });
    • This reply was modified 3 years, 9 months ago by Nabil Lemsieh.

    Thanks for the quick response!
    I found out that the plugin will only work if I activate it every time I upload it, as the button does not stay activated, by default!https://imgpile.com/images/7rlrIE.jpg

    In addition, my site works with subscribers uploading their own images, so images are not automatically resized!
    Is there any possibility that the images will be resized even if they are sent by users via the website frontend?

    Plugin Author Nabil Lemsieh

    (@nlemsieh)

    Hi @markk26

    I found out that the plugin will only work if I activate it every time I upload it, as the button does not stay activated, by default

    Since the plugin only resizes product images by default, when uploading an image directly through the Media Library (under Media menu) you need to manually mark the image as a product-image by turning on that button, we do this to avoid resizing non-product images like blog images, theme images, etc . However, when uploading an image through the product admin interface (under Products menu) the plugin can automatically now that the image is attached to a product.

    If you want to resize any uploaded image, add this code to functions.php under Appearance menu > Theme Editor:

    add_filter('wp_sir_is_attached_to', '__return_true');

    In addition, my site works with subscribers uploading their own images, so images are not automatically resized!
    Is there any possibility that the images will be resized even if they are sent by users via the website frontend?

    To resize images uploaded from the front end, you can use this code:

    add_filter('wp_sir_process_frontend_upload', '__return_true');

    Plugin Author Nabil Lemsieh

    (@nlemsieh)

    Hello,

    I’m marking this thread as resolved for now due to inactivity, if you still need help feel free to reply or start a new ticket and I’ll be more than happy to assist.

    Best,
    Nabil

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Product page images don’t resize’ is closed to new replies.