public static string RenderSelectedOptions(string xml) { if (string.IsNullOrEmpty(xml)) { return(string.Empty); } var result = new StringBuilder("<div class=\"customoptions\">"); foreach (var item in CustomOptionsService.DeserializeFromXml(xml)) { result.Append(item.CustomOptionTitle); result.Append(": "); result.Append(item.OptionTitle); if (item.OptionPriceBc != 0) { result.Append(" "); if (item.OptionPriceBc > 0) { result.Append("+"); } result.Append(CatalogService.GetStringPrice(item.OptionPriceBc)); } result.Append("<br />"); } result.Append("</div>"); return(result.ToString()); }
public static void SendCertificateMails(GiftCertificate certificate) { string htmlMessage = SendMail.BuildMail(new ClsMailParamOnSendCertificate { CertificateCode = certificate.CertificateCode, FromName = certificate.FromName, ToName = certificate.ToName, Message = certificate.CertificateMessage, Sum = CatalogService.GetStringPrice(certificate.Sum) }); SendMail.SendMailNow(certificate.Email, Resources.Resource.Admin_GiftCertificate_Certificate, htmlMessage, true); SendMail.SendMailNow(certificate.FromEmail, Resources.Resource.Admin_GiftCertificate_CertificateSend + " " + certificate.Email, htmlMessage, true); }
public static string RenderPrice(decimal productPrice, decimal discount, bool showDiscount, CustomerGroup customerGroup, string customOptions = null) { if (productPrice == 0) { return(string.Format("<div class=\'price\'>{0}</div>", Resource.Client_Catalog_ContactWithUs)); } string res; decimal price = ProductService.CalculateProductPrice(productPrice, discount, customerGroup, CustomOptionsService.DeserializeFromXml(customOptions), false); decimal priceWithDiscount = ProductService.CalculateProductPrice(productPrice, discount, customerGroup, CustomOptionsService.DeserializeFromXml(customOptions), true); // Added By Evgeni for new price string priceForConvertString = CatalogService.GetStringPrice(priceWithDiscount).Replace(CurrencyService.CurrentCurrency.Symbol, "").Replace(" ", ""); var newPrice = GenerateNewBelarusPrice(priceForConvertString); // //Changed by Evgeni to calculate final discount decimal groupDiscount = customerGroup.CustomerGroupId == 0 ? 0 : customerGroup.GroupDiscount; discount = Math.Max(discount, groupDiscount); // if (price == priceWithDiscount || !showDiscount) { res = string.Format("<div class=\'price\'>{0}</div>", (CatalogService.GetStringPrice(priceWithDiscount))); } else { res = string.Format("<div class=\"price-old\">{0}</div><div class=\"price\">{1}</div><div class=\"price-benefit\">{2} {3} {4} {5}% </div>", (CatalogService.GetStringPrice(productPrice)), (CatalogService.GetStringPrice(priceWithDiscount)), Resource.Client_Catalog_Discount_Benefit, (CatalogService.GetStringPrice(price - priceWithDiscount)), Resource.Client_Catalog_Discount_Or, CatalogService.FormatPriceInvariant(discount)); } //Added by Evgeni res = res + string.Format("<div class=\"price-newformat\">{0}</div>", GenerateNewBelarusPrice(CatalogService.GetStringPrice(priceWithDiscount))); return(res); }