0

I would like to resize the 100px x 100px store thumbnail images.

The sizes are supposed to be set under Appearance › Customize › WooCommerce › Product Images

These size settings are missing.

After an exhaustive search, it is obvious that the sizes only appear there if they are not set in functions.php in the theme via (for example):

add_theme_support( 'woocommerce', array(
    'thumbnail_image_width'         => 200,
    'gallery_thumbnail_image_width' => 100,
    'single_image_width'            => 500,
) );

However, I am using theme Twenty Fifteen, WooCommerce 3.5.5, and Elementor.

The above code is not in the theme.

I have tried disabling all plugins except WooCommerce.

I have tried several different themes, none of which include the add_theme_support code.

Why are the custom images sizes not available?

I would like to avoid having to add code… I'm a programmer but I'm going to be building a bunch of WP/WC sites in the next few months and it would be nice to avoid having to modify the theme or the WP installation for every site.

2 Answers 2

1

WooCommerce itself registers support for the default themes. For Twenty Fifteen it registers the following:

add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
add_theme_support( 'woocommerce', array(
    'thumbnail_image_width' => 200,
    'single_image_width'    => 350,
) );

This is why those settings are not in the Customiser.

However, regardless of what theme support is registered, the gallery_thumbnail_image_width size is never editable in the Customiser.

These default settings were chosen for a reason though, so if you need to change them then that suggests you're changing the theme in some way, in which case you should be working on a child theme, rather than modifying the original theme. In that case your child theme should register its own support for WooCommerce. Then you can either omit the values so that the settings appear in the Customiser, or set your own.

6
  • So it's the fact that I'm using the default themes that causes this behavior? My thumbnails are 100x100px, but the code you show would make them 200px. I have tried soooo many things to change the size, regenerated them several times, but to no avail. Since I am using Elementor, I just want a simple theme that will stay out of the way. I tried underscores and still no way to change the thumbnails.
    – Andy Swift
    Commented Mar 7, 2019 at 11:55
  • Can you share a link to a page where the issue is apparent? Commented Mar 7, 2019 at 12:00
  • dev.larockinerie.fr/product/zenith-jungle I understand what you wrote, but it seems contradictory… the theme doesn't allow me to set the thumbnail size and WooCommerce, which would usually let me set the size, automatically registers the theme. Why would they do that? "This setting is overridden by the theme (which doesn't have this setting)".
    – Andy Swift
    Commented Mar 7, 2019 at 12:26
  • I am going to do a fresh WP install for a blank site and make sure there's not some leftover crap from a previous plugin that corrupted my installation.
    – Andy Swift
    Commented Mar 7, 2019 at 12:27
  • Mate I can tell you the exact file that WooCommerce does this (includes/theme-support/class-wc-twenty-fifteen.php), it's not a corrupted installation. WooCommerce automatically adds support for the default themes because they're the most common and they want users to have an optimal experience with them. It's that simple. Commented Mar 7, 2019 at 12:28
0

I found the following plugin, which worked to resize the gallery thumbnails:

custom-image-sizes-for-woocommerce.zip

available at https://cld.wthms.co/O4lsZz

The plugin restores the ability to change image sizes under Appearance › Customize › WooCommerce › Product Images

It was necessary to use the Regenerate Thumbnails plugin after changing the image sizes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.