/// <summary> /// A collection of the tokens and the replaceable content for email templates. /// </summary> /// <param name="context">An instance of the Hotcakes Request context.</param> /// <returns>List of HtmlTemplateTag</returns> public List <HtmlTemplateTag> GetReplaceableTags(HccRequestContext context) { var result = new List <HtmlTemplateTag>(); var culture = context.MainContentCulture; result.Add(new HtmlTemplateTag("[[LineItem.AdjustedPrice]]", AdjustedPricePerItem.ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.BasePrice]]", BasePricePerItem.ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.LineTotalBeforeVAT]]", (LineTotal - TaxPortion).ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.Discounts]]", DiscountDetailsAsHtml())); result.Add(new HtmlTemplateTag("[[LineItem.LineTotal]]", LineTotal.ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.ProductId]]", ProductId)); result.Add(new HtmlTemplateTag("[[LineItem.VariantId]]", VariantId)); result.Add(new HtmlTemplateTag("[[LineItem.ProductName]]", ProductName)); result.Add(new HtmlTemplateTag("[[LineItem.ProductSku]]", ProductSku)); result.Add(new HtmlTemplateTag("[[LineItem.Sku]]", "Obsolete. Please use [[LineItem.ProductSku]] instead.", true)); result.Add(new HtmlTemplateTag("[[LineItem.ProductDescription]]", ProductShortDescription)); result.Add(new HtmlTemplateTag("[[LineItem.Quantity]]", Quantity.ToString("#"))); result.Add(new HtmlTemplateTag("[[LineItem.QuantityShipped]]", QuantityShipped.ToString("#"))); result.Add(new HtmlTemplateTag("[[LineItem.QuantityReturned]]", QuantityReturned.ToString("#"))); result.Add(new HtmlTemplateTag("[[LineItem.ShippingStatus]]", LocalizationUtils.GetOrderShippingStatus(ShippingStatus, culture))); result.Add(new HtmlTemplateTag("[[LineItem.TaxRate]]", decimal.Parse(TaxRate.ToString("p3").Replace("%", "")).ToString("G29") + " %")); result.Add(new HtmlTemplateTag("[[LineItem.ShippingPortion]]", ShippingPortion.ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.TaxPortion]]", TaxPortion.ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.ExtraShipCharge]]", ExtraShipCharge.ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.ShipFromAddress]]", ShipFromAddress.ToHtmlString())); result.Add(new HtmlTemplateTag("[[LineItem.ShipSeparately]]", ShipSeparately ? "Yes" : "No")); return(result); }
public override string ToString() { StringBuilder result = new StringBuilder(); if (IsSetTitle()) { result.Append("Title: "); result.AppendLine(Title); } if (IsSetASIN()) { result.Append("ASIN: "); result.AppendLine(ASIN); } if (IsSetSellerSKU()) { result.Append("SKU: "); result.AppendLine(SellerSKU); } if (IsSetItemPrice()) { result.Append("Price: "); result.AppendLine(ItemPrice.ToString()); } if (IsSetItemTax()) { result.Append("Item Tax: "); result.AppendLine(ItemTax.ToString()); } if (IsSetPromotionDiscount()) { result.Append("Promotions Discount: "); result.AppendLine(PromotionDiscount.ToString()); } if (IsSetPromotionIds()) { if (PromotionIds.PromotionId != null) { foreach (string promotionId in PromotionIds.PromotionId) { result.Append("\tPromotion Id: "); result.AppendLine(promotionId); } } } if (IsSetShippingDiscount()) { result.Append("Shipping Discount: "); result.AppendLine(ShippingDiscount.ToString()); } if (IsSetQuantityOrdered()) { result.Append("Quantity: "); result.AppendLine(QuantityOrdered.ToString()); } if (IsSetQuantityShipped()) { result.Append("Quantity Shipped: "); result.AppendLine(QuantityShipped.ToString()); } if (IsSetCODFee()) { result.Append("COD Fee: "); result.AppendLine(CODFee.ToString()); } if (IsSetCODFeeDiscount()) { result.Append("COD Fee Discount: "); result.AppendLine(CODFeeDiscount.ToString()); } if (IsSetGiftMessageText()) { result.Append("Gift Message Text: "); result.AppendLine(GiftMessageText); } if (IsSetGiftWrapPrice()) { result.Append("Gift Wrap Price: "); result.AppendLine(GiftWrapPrice.ToString()); } if (IsSetGiftWrapLevel()) { result.Append("Gift Wrap Level: "); result.AppendLine(GiftWrapLevel.ToString()); } return(result.ToString()); }