Base class for shipping providers, holding the common configuration and cost/weight calculations that concrete providers build on. Tracks the countries a provider serves and the weight and cart-cost bounds it applies, and offers helper methods for computing volumetric weight, effective SKU weight, total cart weight, and cart cost. Subclasses such as DefaultShippingProvider and ExpressionShippingProvider use these to decide availability and calculate freight.

Group: E-commerce

Implements: ShippingProvider


Properties

PropertyReturnsDescription
availableCountriesList<String>The countries this provider ships to.
detailedDescriptionStringA formatted summary of the configured countries and weight limits for this provider.
idStringThe identifier for this provider, used in forms where a user selects a shipping provider.
maxCartCostBigDecimalThe maximum cart cost for which this provider is available.
maxTotalWeightKgsBigDecimalThe maximum total cart weight, in kilograms, for which this provider is available.
minCartCostBigDecimalThe minimum cart cost for which this provider is available.
minTotalWeightKgsBigDecimalThe minimum total cart weight, in kilograms, for which this provider is available.
titleStringThe user-friendly display title for this shipping provider.

Inherited from ShippingProvider

Properties

PropertyReturnsDescription
managementPageTemplateStringThe name of the admin template used to render this provider's configuration and management page.

Methods

calcIndividualFreight(ProductSku productSku, BigDecimal quantity, InventoryLocation shipFrom)

Returns: BigDecimal

Calculates the freight cost for shipping a single quantity of a product SKU from a given location. Note that this may not give the same result as shipping the same items as part of a full cart, since cart level freight calculation can combine or discount items differently.

ParameterDescription
productSkuthe product SKU being shipped
quantitythe quantity of the SKU being shipped
shipFromthe inventory location the item ships from

calcCartFreight(Cart cart)

Returns: BigDecimal

Calculates the total freight cost for shipping everything in the given cart.

ParameterDescription
cartthe cart to calculate freight for

isAvailable(Cart cart)

Returns: boolean

Whether this provider can be offered as a shipping option for the given cart, eg because it covers the shipping destination or the cart's contents.

ParameterDescription
cartthe cart to check availability for

getManagementPageTemplate()

Returns: String

The name of the admin template used to render this provider's configuration and management page.


Methods

getId()

Returns: String

The identifier for this provider, used in forms where a user selects a shipping provider.

getTitle()

Returns: String

The user-friendly display title for this shipping provider.

getDetailedDescription()

Returns: String

A formatted summary of the configured countries and weight limits for this provider.

getMinTotalWeightKgs()

Returns: BigDecimal

The minimum total cart weight, in kilograms, for which this provider is available.

getMaxTotalWeightKgs()

Returns: BigDecimal

The maximum total cart weight, in kilograms, for which this provider is available.

getMinCartCost()

Returns: BigDecimal

The minimum cart cost for which this provider is available.

getMaxCartCost()

Returns: BigDecimal

The maximum cart cost for which this provider is available.

getAvailableCountries()

Returns: List<String>

The countries this provider ships to.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.