Price/Amount Adjustments
Learn about adjusting prices in Umbraco Commerce.
Creating Custom Adjustments
public class MyPriceAdjuster : PriceAdjusterBase
{
public override void ApplyPriceAdjustments(PriceAdjusterArgs args)
{
// Calculate Adjustment
// Discount adjustments should be negative
// where as Fee adjustments should be positive
// Create a £10 discount
var price = new Price(-8.33, -1.67, args.Order.CurrencyId);
var adjustment = new MyAdjustment("My Discount", "MD-001", price);
// Add the adjustment to the sub total price
args.SubtotalPriceAdjustments.Add(adjustment);
}
}Last updated
Was this helpful?