Customize "OrderCompleted.CustomerNotification"

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
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
9 years ago
SKU will show if you have Catalog Setting "Show SKU:" checked.
(What other fields do you want to show?)
9 years ago
I want to show fields like priceincltax,priceexctax,Discount etc. But i need to display them as new columns
9 years ago
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.