Discounts on MessageTokenProvider.cs

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 年 前
Hello,

Is there a way to include discounts applied to categories, discounts applied to manufacturers, and other similar discounts to show the amount, codes, and other information on the email?

I've read the MessageTokenProvider.cs file and that it has both discounts applied to subtotal & discounts applied to total but not sure how do I add the other types of discounts?

Please advise. Thank you!
2 年 前
I believe that those discounts get applied to the order items.  So, you'd probably have to modify method ProductListToHtmlTable(), and look at properties like

DiscountAmountInclTax
DiscountAmountExclTax
2 年 前
Is there a way to get the total discount amount applied and the discount code (if any) on the order item(s) level?

With Nopcommerce defaults, if the discount is applied by category or manufacturer the email doesn't show the discount(s) applied (in the cart it shows "You Save" on each items affected). What we'd like to do is have a total of how much they saved and add a "Discounts" row in the ProductListToHtmlTable method (with default it doesn't show but only shows the total after savings).

I've looked up Order.cs methods OrderSubtotalIncTax and OrderSubtotalExclTax, so basically something similar to that but I have not seen something similar under Products.cs or Manufacturer.cs.

Are there other places I can look? Or is there a way to do this?

Thank you!
2 年 前
Yes, as mentioned above, ProductListToHtmlTable loops through order items, so you can get item discount amounts.   Getting codes per order item is not so straightforward, because multiple discounts can apply. Codes are entered at the cart level, and then the discount logic determines how to apply them.
2 年 前
I see. Got it! Thank you so much for your help!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.