I want to add new fields in token "%Order.Product(s)%" like SKU or another order field when i send email notification to my customer (after order payment status marked as "Paid".) Needs to modify "MessageTokenProvider.cs"? Can you help me with the code? Thanks
Look at method protected virtual string ProductListToHtmlTable(Order order, int languageId, int vendorId)
It's all in there.
E.g. table headers... sb.AppendLine(string.Format("<th>{0}</th>", _localizationService.GetResource("Messages.Order.Product(s).Name", languageId)));
E.g. table lines sb.AppendLine(string.Format("<td style=\"padding: 0.6em 0.4em;text-align: right;\">{0}</td>", unitPriceStr));
Prices with and without tax: var priceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceInclTax, order.CurrencyRate); priceStr = _priceFormatter.FormatPrice(priceInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, language, true); ... var priceExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceExclTax, order.CurrencyRate);
For "Discount", you can probably subtract orderItem.PriceExclTax from product.Price, and then convert to customer currency.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.