Home > widget-integration > TierDiscountService > recalculateTotals
TierDiscountService.recalculateTotals() method
Recalculates bundle totals and tier achievements. Override to customize calculation logic.
Signature:
protected recalculateTotals(model: TierDiscountModel): TierDiscountModel;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
model |
Current model |
Returns:
Model with updated totals
Example
protected recalculateTotals(model: TierDiscountModel): TierDiscountModel {
const updated = super.recalculateTotals(model);
// Add shipping calculation
updated.properties.shippingCost = this.calculateShipping(updated);
return updated;
}