Class FreeShippingPromotionRuleBase<TPromotionRuleProperties, TPriceCalculationRequest, TPriceCalculationResult>
Abstract base class for a free shipping promotion rule. New free shipping promotion rules should inherit from
this class. To use inbuilt properties, inherit from FreeShippingPromotionRule.
public abstract class FreeShippingPromotionRuleBase<TPromotionRuleProperties, TPriceCalculationRequest, TPriceCalculationResult> : PromotionRuleBase<TPromotionRuleProperties, TPriceCalculationRequest, TPriceCalculationResult>, IPromotionRule<TPriceCalculationRequest, TPriceCalculationResult>, IPromotionRule where TPromotionRuleProperties : IPromotionRuleProperties, new() where TPriceCalculationRequest : IPriceCalculationRequest where TPriceCalculationResult : IPriceCalculationResult
Type Parameters
TPromotionRulePropertiesType containing promotion rule properties.
TPriceCalculationRequestPrice calculation request type.
TPriceCalculationResultPrice calculation result type.
- Inheritance
-
objectPromotionRuleBase<TPromotionRuleProperties, TPriceCalculationRequest, TPriceCalculationResult>FreeShippingPromotionRuleBase<TPromotionRuleProperties, TPriceCalculationRequest, TPriceCalculationResult>
- Implements
-
IPromotionRule<TPriceCalculationRequest, TPriceCalculationResult>
- Derived
- Inherited Members
- Extension Methods
Constructors
FreeShippingPromotionRuleBase()
protected FreeShippingPromotionRuleBase()
Methods
GetDiscountValueLabel()
Gets a human-readable label representing the discount value for display purposes.
public virtual string GetDiscountValueLabel()
Returns
- string
A formatted string representing the reward (e.g., "Free shipping"). Returns
nullby default if not overridden in derived classes.
Remarks
This method is typically used to populate the display label in promotion candidates, which can be shown to users in the UI.
GetPromotionCandidate(IPriceCalculationData<TPriceCalculationRequest, TPriceCalculationResult>)
Gets the promotion candidate that can be used for the whole order.
public abstract FreeShippingPromotionCandidate GetPromotionCandidate(IPriceCalculationData<TPriceCalculationRequest, TPriceCalculationResult> calculationData)
Parameters
calculationDataIPriceCalculationData<TPriceCalculationRequest, TPriceCalculationResult>Price calculation data.
Returns
- FreeShippingPromotionCandidate
Promotion candidate,
nullif the promotion is not applicable for the order.
Remarks
The price calculation applies one free shipping candidate at most: the one activated by the customer's coupon code, otherwise the newest one. Free shipping is an order-level reward - it does not touch any cart item and does not compete with the catalog discount.