public static string UserSpecificPriceForDisplay(Catalog.UserSpecificPrice price) { StringBuilder sb = new StringBuilder(); if (price.ListPriceGreaterThanCurrentPrice) { sb.Append("<label>" + Content.SiteTerms.GetTerm(Content.SiteTermIds.ListPrice) + "</label>"); sb.Append("<span class=\"choice\"><strike>"); sb.Append(price.ListPrice.ToString("C")); sb.Append("</strike></span>"); } sb.Append("<label>" + Content.SiteTerms.GetTerm(Content.SiteTermIds.SitePrice) + "</label>"); sb.Append("<span class=\"choice\">"); sb.Append(price.DisplayPrice()); sb.Append("</span>"); if ((price.BasePrice < price.ListPrice) && (price.OverrideText.Trim().Length < 1)) { sb.Append("<label>" + Content.SiteTerms.GetTerm(Content.SiteTermIds.YouSave) + "</label>"); sb.Append("<span class=\"choice\">"); sb.Append(price.Savings.ToString("c") + " - " + price.SavingsPercent + System.Threading.Thread.CurrentThread.CurrentUICulture.NumberFormat.PercentSymbol); sb.Append("</span>"); } sb.Append("<div class=\"clear\"></div>"); return sb.ToString(); }
public static void RenderSingleProduct(ref StringBuilder sb, Catalog.Product p, bool isLastInRow, bool isFirstInRow, System.Web.UI.Page page, Catalog.UserSpecificPrice price) { string destinationLink = Utilities.UrlRewriter.BuildUrlForProduct(p, page); string imageUrl = MerchantTribe.Commerce.Storage.DiskStorage.ProductImageUrlSmall( ((IMultiStorePage)page).MTApp, p.Bvin, p.ImageFileSmall, page.Request.IsSecureConnection); if (isLastInRow) { sb.Append("<div class=\"record lastrecord\">"); } else if (isFirstInRow) { sb.Append("<div class=\"record firstrecord\">"); } else { sb.Append("<div class=\"record\">"); } sb.Append("<div class=\"recordimage\">"); sb.Append("<a href=\"" + destinationLink + "\">"); sb.Append("<img src=\"" + imageUrl + "\" border=\"0\" alt=\"" + p.ImageFileSmallAlternateText + "\" /></a>"); sb.Append("</div>"); sb.Append("<div class=\"recordname\">"); sb.Append("<a href=\"" + destinationLink + "\">" + p.ProductName + "</a>"); sb.Append("</div>"); sb.Append("<div class=\"recordsku\">"); sb.Append("<a href=\"" + destinationLink + "\">" + p.Sku + "</a>"); sb.Append("</div>"); sb.Append("<div class=\"recordprice\">"); sb.Append("<a href=\"" + destinationLink + "\">" + price.DisplayPrice(true) + "</a>"); sb.Append("</div>"); sb.Append("</div>"); }