Image size in accelerator quicksearch

I’ve noticed that the images in the quicksearch result are full size images. What’s the recommended way to load small thumbnails instead?

Litium version: 7.1

Hi, we have received a bug report before and have fixed it. The fix will soon be released. In the meantime, you can apply it to your code base:

In ProductSearchResult.cs, in Resolve method, modify
return firstImg.HasValue ? _fileService.Get(firstImg.Value)?.MapTo<FileModel>().Url : null;
to:
return firstImg.HasValue ? _fileService.Get(firstImg.Value)?.MapTo<ImageModel>().GetUrlToImage(Size.Empty, new Size(30, -1)).Url : null;

Same thing with CategorySearchResult.cs.Resolve:
return firstImg.HasValue ? _fileService.Get(firstImg.Value)?.MapTo<FileModel>().Url : null;
to:
return firstImg.HasValue ? _fileService.Get(firstImg.Value)?.MapTo<ImageModel>().GetUrlToImage(Size.Empty, new Size(30, -1)).Url : null;

1 Like

Looks like this and many other fixes for the quicksearch is included in 7.2.0. other issues are that search in performed very keystroke witch get worse by that all hits are loaded every search.

As for images full size images are also loaded on the product page.