var pictureThumbnailUrl = _pictureService.GetPictureUrl(defaultProductPicture, 75, true);
Do I put it above in code and then how can I give link to image itself?
I mean I need to create links for the images... I know only product IDs...
Like this: PRODUCTS TO BE ORDERED ID 145 — site.com/product-145/thumb.jpg ID 1165 — site.com/product-1165/thumb.jpg ID 5 — site.com/product-5/thumb.jpg
The first routine uses the productId to get the default picture the secord routine gets the URL for the default picture
Thank you Yidna. I cannot understand how to do it :) I already know product ids. I don't need to parse them. I just need to create image link using product IDs. Like this: site.com/product-145/thumb.jpg
So if I put this code manually, it must show me thumb of the product with id 145...
What file are you changing ? This is some basic code
You would put this up the top
@using Nop.Services.Media
@{ var productId = 100; var pictureService = EngineContext.Current.Resolve<IPictureService>(); var defaultProductPicture = pictureService.GetPicturesByProductId(productId, 1).FirstOrDefault(); if (defaultProductPicture != null) var pictureThumbnailUrl = pictureService.GetPictureUrl(defaultProductPicture, 75, true); }