protected void BindProductVariantInfo(ProductVariant productVariant) { btnAddToWishlist.Visible = this.SettingManager.GetSettingValueBoolean("Common.EnableWishlist"); //sku if (this.SettingManager.GetSettingValueBoolean("Display.Products.ShowSKU") && !String.IsNullOrEmpty(productVariant.SKU)) { phSKU.Visible = true; lSKU.Text = Server.HtmlEncode(productVariant.SKU); } else { phSKU.Visible = false; } //manufacturer part number if (this.SettingManager.GetSettingValueBoolean("Display.Products.ShowManufacturerPartNumber") && !String.IsNullOrEmpty(productVariant.ManufacturerPartNumber)) { phManufacturerPartNumber.Visible = true; lManufacturerPartNumber.Text = Server.HtmlEncode(productVariant.ManufacturerPartNumber); } else { phManufacturerPartNumber.Visible = false; } ctrlTierPrices.ProductVariantId = productVariant.ProductVariantId; ctrlProductAttributes.ProductVariantId = productVariant.ProductVariantId; ctrlGiftCardAttributes.ProductVariantId = productVariant.ProductVariantId; ctrlProductPrice.ProductVariantId = productVariant.ProductVariantId; //stock string stockMessage = productVariant.FormatStockMessage(); if (!String.IsNullOrEmpty(stockMessage)) { lblStockAvailablity.Text = stockMessage; } else { pnlStockAvailablity.Visible = false; } //price entered by a customer if (productVariant.CustomerEntersPrice) { decimal minimumCustomerEnteredPrice = this.CurrencyService.ConvertCurrency(productVariant.MinimumCustomerEnteredPrice, this.CurrencyService.PrimaryStoreCurrency, NopContext.Current.WorkingCurrency); decimal maximumCustomerEnteredPrice = this.CurrencyService.ConvertCurrency(productVariant.MaximumCustomerEnteredPrice, this.CurrencyService.PrimaryStoreCurrency, NopContext.Current.WorkingCurrency); txtCustomerEnteredPrice.Visible = true; txtCustomerEnteredPrice.ValidationGroup = string.Format("ProductVariant{0}", productVariant.ProductVariantId); txtCustomerEnteredPrice.Value = minimumCustomerEnteredPrice; txtCustomerEnteredPrice.MinimumValue = minimumCustomerEnteredPrice.ToString(); txtCustomerEnteredPrice.MaximumValue = maximumCustomerEnteredPrice.ToString(); txtCustomerEnteredPrice.RangeErrorMessage = string.Format(GetLocaleResourceString("Products.CustomerEnteredPrice.Range"), PriceHelper.FormatPrice(minimumCustomerEnteredPrice, false, false), PriceHelper.FormatPrice(maximumCustomerEnteredPrice, false, false)); } else { txtCustomerEnteredPrice.Visible = false; } //buttons if (!productVariant.DisableBuyButton) { txtQuantity.ValidationGroup = string.Format("ProductVariant{0}", productVariant.ProductVariantId); btnAddToCart.ValidationGroup = string.Format("ProductVariant{0}", productVariant.ProductVariantId); btnAddToWishlist.ValidationGroup = string.Format("ProductVariant{0}", productVariant.ProductVariantId); txtQuantity.Value = productVariant.OrderMinimumQuantity; } else { txtQuantity.Visible = false; btnAddToCart.Visible = false; btnAddToWishlist.Visible = false; } //samle downlaods if (pnlDownloadSample != null && hlDownloadSample != null) { if (productVariant.IsDownload && productVariant.HasSampleDownload) { pnlDownloadSample.Visible = true; hlDownloadSample.NavigateUrl = this.DownloadService.GetSampleDownloadUrl(productVariant); } else { pnlDownloadSample.Visible = false; } } //final check - hide prices for non-registered customers if (!this.SettingManager.GetSettingValueBoolean("Common.HidePricesForNonRegistered") || (NopContext.Current.User != null && !NopContext.Current.User.IsGuest)) { // } else { txtCustomerEnteredPrice.Visible = false; txtQuantity.Visible = false; btnAddToCart.Visible = false; btnAddToWishlist.Visible = false; } }