I did find https://docs.kentico.com/13/e-commerce-features/customizing-on-line-stores/customizing-discounts but I don't want to recalculate an OrderInfo object. I want to get the discount applied at time of calc originally. I am starting with this code.
/// <summary>
/// Gets all the different discounts from the OrderInfo object and returns a summary of the discounts without any currency conversion.
/// </summary>
/// <param name="order"><see cref="OrderInfo"/> object to get discounts from</param>
/// <param name="includeGiftCards">Set to true to also calculate discounts from any gift cards as discounts instead of treating as payment after the total.</param>
/// <returns><see cref="Decimal"/> total discounts added </returns>
/// <remarks>See https://devnet.kentico.com/questions/k13-orderinfo-get-total-discounts</remarks>
public static ValuesSummary GetAllDiscounts(this OrderInfo order, bool includeGiftCards = false)
{
var orderDiscountSummary = new ValuesSummary(order.OrderDiscounts);
var itemTotalDiscounts = new ValuesSummary();
foreach (var orderItem in OrderItemInfoProvider.GetOrderItems(order.OrderID))
{
var productDiscountsSummary = new ValuesSummary(orderItem.OrderItemProductDiscounts);
foreach (var productDiscount in productDiscountsSummary)
{
productDiscount.Value *= orderItem.OrderItemUnitCount;
}
itemTotalDiscounts.Merge(productDiscountsSummary);
var itemDiscountsSummary = new ValuesSummary(orderItem.OrderItemDiscountSummary);
itemTotalDiscounts.Merge(itemDiscountsSummary);
}
orderDiscountSummary.Merge(itemTotalDiscounts);
if (includeGiftCards)
{
var giftCardsSumary = new ValuesSummary(order.OrderOtherPayments);
orderDiscountSummary.Merge(giftCardsSumary);
}
return orderDiscountSummary;
}
}