Set an image size for the wishlist items

The plugin comes with two images sizes, nmgr_thumbnail and nmgr_medium which are used for the wishlist items in the list and grid views respectively, as shown in the screenshots below.

List view
Grid view

If these image sizes don’t match with your theme, or for any other reason you want to change them, it is possible to set a custom size that would be used for the wishlist items. If for example you want to use the default image size woocommerce uses for products, woocommerce_thumbnail, you can do this:

add_filter( 'nmgr_item_view_image_size', 'set_nmgr_item_view_image_size' );

function set_nmgr_item_view_image_size() {
	return 'wocoommerce_thumbnail';
}

Note that this filter runs throughout the frontend, so if you want to set the image size only on the wishlist page without affecting the wishist management page, you should do this instead:

add_filter( 'nmgr_item_view_image_size', 'set_nmgr_item_view_image_size' );

function set_nmgr_item_view_image_size( $size ) {
	if ( is_nmgr_wishlist() ) {
		return 'wocoommerce_thumbnail';
	}
	return $size;
}

When using the pro version, if you want to set a custom image size when viewing the wishist items in a grid, you can do this:

add_filter( 'nmgr_item_view_image_size', 'set_nmgr_item_view_image_size', 10, 2 );

function set_nmgr_item_view_image_size( $size, $view ) {
	if ( 'grid' === $view->get_display()[ 'mode' ] ) {
		return 'woocommerce_thumbnail';
	}
	return $size;
}

Notice that the function above takes in a second parameter $view. So this should be accounted for when the filter is called.