Table of Contents

Class FreeShippingPromotionRuleBase<TPromotionRuleProperties, TPriceCalculationRequest, TPriceCalculationResult>

Namespace
CMS.Commerce
Assembly
CMS.Commerce.dll

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

TPromotionRuleProperties

Type containing promotion rule properties.

TPriceCalculationRequest

Price calculation request type.

TPriceCalculationResult

Price calculation result type.

Inheritance
object
PromotionRuleBase<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 null by 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

calculationData IPriceCalculationData<TPriceCalculationRequest, TPriceCalculationResult>

Price calculation data.

Returns

FreeShippingPromotionCandidate

Promotion candidate, null if 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.