Product photos not displaying correctly on Product page


#1

Hello,

I have a problem with displaying images of my products on product page.

The site’s name is www.naplece.sk, the particular product for example this one.

The first image is absolutely okay, but when I click on the second image in gallery, it shows only half of the image. Both images have the same proportions.

How can I solve this? Thank you.

Best regards,
Stanislav


#2

Hello there,

I notice this is an issue that should be corrected in the next version update. To resolve it yourself, try adding the below PHP function to your child theme’s functions.php file.

    add_filter( 'woocommerce_get_image_size_gallery_thumbnail', 'leto_child_gallery_single_size', 9999 );
    function leto_child_gallery_single_size($size=array()) {

      $size['width']  = 600;
      $size['height'] = 99999;
      $size['crop']   = 0;

      return $size;

    }

If you aren’t running any child theme, you could also achieve the same purpose with a plugin like Functionality.

Regards,
Kharis


#3

Hello, thanks for your prompt replies.

I run only Leto theme, so I downloaded and installed the Functionality plugin, pasted the code there, but it still doesn’t work. Any ideas why? Thanks.


#4

Hello there,

You might need to clear site caching whenever new code added, only if caching applied.

https://codex.wordpress.org/I_Make_Changes_and_Nothing_Happens

Or, try with the Code Snippets plugin. If you use it, deactivate/delete the Functionalily from your plugin list.

Regards,
Kharis


#5

Hello,

now it WORKS! I used the Code snippets plugin and it works just fine. Thank you very much!

So this should be updated in the future version update? What does it mean for me now? I would need to delete the snippet or would it cause any trouble while having it there? Thank you.

Regards,
Stanislav


#6

Great!

At this time, keep the code reamins in your Code Snippets until the next update available.

Regards,
Kharis