Hi vasa
here is the code
in RecentlyViewedProductsBox.ascx add
<asp:Image ID="imProductImage" runat="server"/>
like so
<%@ Control Language="C#" AutoEventWireup="true"
Inherits="NopSolutions.NopCommerce.Web.Modules.RecentlyViewedProductsBoxControl" Codebehind="RecentlyViewedProductsBox.ascx.cs" %>
<div class="block block-recently-viewed-products">
<div class="title">
<%=GetLocaleResourceString("Products.RecentlyViewedProducts")%>
</div>
<div class="clear">
</div>
<div class="listbox">
<asp:ListView ID="lvRecentlyViewedProducts" runat="server" OnItemDataBound="lvRecentlyViewedProducts_ItemDataBound" EnableViewState="false">
<LayoutTemplate>
<ul>
<asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
</ul>
</LayoutTemplate>
<ItemTemplate>
<li>
<asp:Image ID="imProductImage" runat="server"/>
<asp:HyperLink ID="hlProduct" runat="server" Text='<%#Server.HtmlEncode(Eval("LocalizedName").ToString()) %>' />
</li>
</ItemTemplate>
<ItemSeparatorTemplate>
<li class="separator">
</li>
</ItemSeparatorTemplate>
</asp:ListView>
</div>
</div>
in the code behind file RecentlyViewedProductsBox.ascx.cs add the following code in lvRecentlyViewedProducts_ItemDataBound
// DMB 19/04/2012 added picture thumb
Image imProductImage = dataItem.FindControl("imProductImage") as Image;
if (imProductImage != null)
{
var picture = product.DefaultPicture;
if (picture != null)
{
imProductImage.ImageUrl = this.PictureService.GetPictureUrl(picture, 70, true);
imProductImage.ToolTip = String.Format(GetLocaleResourceString("Media.Product.ImageLinkTitleFormat"), product.LocalizedName);
}
else
{
imProductImage.ImageUrl = this.PictureService.GetDefaultPictureUrl(70);
imProductImage.ToolTip = String.Format(GetLocaleResourceString("Media.Product.ImageLinkTitleFormat"), product.LocalizedName);
}
}
like this
protected void lvRecentlyViewedProducts_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
var dataItem = e.Item as ListViewDataItem;
if (dataItem != null)
{
var product = dataItem.DataItem as Product;
if (product != null)
{
var hlProduct = dataItem.FindControl("hlProduct") as HyperLink;
hlProduct.NavigateUrl = SEOHelper.GetProductUrl(product);
// DMB 19/04/2012 added picture thumb
Image imProductImage = dataItem.FindControl("imProductImage") as Image;
if (imProductImage != null)
{
var picture = product.DefaultPicture;
if (picture != null)
{
imProductImage.ImageUrl = this.PictureService.GetPictureUrl(picture, 70, true);
imProductImage.ToolTip = String.Format(GetLocaleResourceString("Media.Product.ImageLinkTitleFormat"), product.LocalizedName);
}
else
{
imProductImage.ImageUrl = this.PictureService.GetDefaultPictureUrl(70);
imProductImage.ToolTip = String.Format(GetLocaleResourceString("Media.Product.ImageLinkTitleFormat"), product.LocalizedName);
}
}
}
}
}
}
HTH
Dave