protected void Page_Init(object sender, EventArgs e) { if (Product != null) { List <CommerceBuilder.Products.ProductImage> images = (from i in Product.Images select i).ToList <CommerceBuilder.Products.ProductImage>(); if (images.Count > 0 && !string.IsNullOrEmpty(Product.ImageUrl)) { images.Insert(0, new CommerceBuilder.Products.ProductImage() { ImageUrl = Product.ImageUrl, ImageAltText = Product.ImageAltText }); } if (images == null || images.Count == 0) { phAdditionalImages.Visible = false; } else { //InstructionTextLabel.Visible = images.Count > 0; //if (!string.IsNullOrEmpty(ThumbnailClickInstructionText)) // InstructionTextLabel.Text = ThumbnailClickInstructionText; MoreImagesList.DataSource = images; MoreImagesList.DataBind(); } } _settings = AbleContext.Current.Store.Settings; }
protected void Page_Init(object sender, EventArgs e) { if (Request.Browser.IsMobileDevice) { _largeImageMaxDimension = 300; } int productId = AbleCommerce.Code.PageHelper.GetProductId(); Product product = ProductDataSource.Load(productId); if (product != null) { this.Page.Title = "Images of " + product.Name; this.GalleryCaption.Text = string.Format(this.GalleryCaption.Text, product.Name); List <ProductImage> images = (from i in product.Images select i) .ToList <ProductImage>(); if (!string.IsNullOrEmpty(product.ImageUrl)) { images.Insert(0, new ProductImage() { ImageUrl = product.ImageUrl, ImageAltText = product.ImageAltText }); } MoreImagesList.DataSource = images; MoreImagesList.DataBind(); } }