if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'cart-thumb', 100, 100 ); // 100 в ширину и 100 в высоту
}
add_filter( 'woocommerce_cart_item_thumbnail', 'change_image_size_in_cart', 10, 2 );
function change_image_size_in_cart( $product_image, $cart_item ) {
if( is_cart() ) {
$product = $cart_item['data'];
$product_image = $product->get_image( 'cart-thumb' );
}
return $product_image;
}