I want to make the gallery thumbnails on the Woocommerce single product page the same size as my main product image. I know I can set the size with this
add_filter( 'woocommerce_get_image_size_gallery_thumbnail', function($size ) {
return array(
'width' => 487,
'height' => 487,
'crop' => 0,
);
});
But I would like to keep small 100x100x Woo thumbnails for the cart page. I read in the Woo docs that you can change which image sized is being used, so I tried
add_filter( 'woocommerce_gallery_thumbnail_size', function( $size ) {
return 'woocommerce_single';
});
but this is not working. Any thoughts why?
There are some hooks available. If you want to change the size using below hook
add_filter( 'wp_get_attachment_image_src', 'your function name', 50, 4 );
Source: https://docs.woocommerce.com/wc-apidocs/hook-docs.html https://businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With