To Zoom the image using lighbox even if only one image has been added for the product in Nopcommerce.14
Make highlighted changes in following files
1.)In Modules/ProductInfo.ascx
<td align="left">
<a href="<%#PictureManager.GetPictureUrl((int)Eval("PictureID"), 600)%>" rel="lightbox-p" title="<%= lProductName.Text%>">
<img src="<%#PictureManager.GetPictureUrl((int)Eval("PictureID"), 70)%>" alt="Product image" /></a>
</td>
2.) In ProductInfo.ascx.cs
ProductPictureCollection productPictures = product.ProductPictures;
if (productPictures.Count >= 1)//Modified For more then 1 image
{
defaultImage.ImageUrl = PictureManager.GetPictureUrl(productPictures[0].PictureID, SettingManager.GetSettingValueInteger("Media.Product.DetailImageSize", 300));
defaultImage.ToolTip = String.Format(GetLocaleResourceString("Media.Product.ImageAlternateTextFormat"), product.Name);
defaultImage.AlternateText = String.Format(GetLocaleResourceString("Media.Product.ImageAlternateTextFormat"), product.Name);
lvProductPictures.DataSource = productPictures;
lvProductPictures.DataBind();
}
//comment out the below existing code
//else if (productPictures.Count == 1)//commented out for //{
// defaultImage.ImageUrl = PictureManager.GetPictureUrl(productPictures[0].PictureID, SettingManager.GetSettingValueInteger("Media.Product.DetailImageSize", 300));
// defaultImage.ToolTip = String.Format(GetLocaleResourceString("Media.Product.ImageAlternateTextFormat"), product.Name);
// defaultImage.AlternateText = String.Format(GetLocaleResourceString("Media.Product.ImageAlternateTextFormat"), product.Name);
// lvProductPictures.Visible = false;
//}
No comments:
Post a Comment