To change thumbnail image size of WooCommerce cart page you need next steps:
1. in function.php create the size you need.
1 2 3 | if ( function_exists( 'add_image_size' ) ) { add_image_size( 'custom-thumb', 100, 100 ); // 100 wide and 100 high } |
2. in cart.php which should be located in your_tneme\woocommerce\cart find
1 | $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key ); |
and in get_image() write the name of your size. In our case it will be like this: get_image(‘custom-thumb’)
Checked work on WooCommerce 3.5.2
This is exactly what I’m looking for, but it’s not working for me. I’m using WooCommerce v4.5.2.
It would be great if you we can get an update on this. Thanks.
This code works with version 4.5.2. Perhaps you are doing something wrong.