Discounts on MessageTokenProvider.cs

Hace 2 meses
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!
Hace 2 meses
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
Hace 2 meses
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!
Hace 2 meses
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.
Hace un mes
I see. Got it! Thank you so much for your help!