1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Product Page
  5. Use a different size for add-on images
  1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Use a different size for add-on images

Use a different size for add-on images

By default, the plugin uses the ‘thumbnail’ size for add-on images. This is normally set by your theme.

If you’d like to use a different size for the add-on image, use the first function in the snippet below:

If you’d like to change the size of the image swatch images, use the second function.

<?php
/**
* Use a different size for add-on images
*/
function prefix_field_image_size( $size ) {
return 'large';
}
add_filter( 'pewc_filter_field_image_size', 'prefix_field_image_size', 10 );
/**
* Use a different size for image swatch images
*/
function prefix_image_swatch_thumbnail_size( $size, $item ) {
return 'large';
}
add_filter( 'pewc_image_swatch_thumbnail_size', 'prefix_image_swatch_thumbnail_size', 10, 2 );

Here’s how to add the snippet.

Was this article helpful?

Related Articles