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
| Property | Returns | Description |
|---|---|---|
| availableCountries | List<String> | The countries this provider ships to. |
| detailedDescription | String | A formatted summary of the configured countries and weight limits for this provider. |
| id | String | The identifier for this provider, used in forms where a user selects a shipping provider. |
| maxCartCost | BigDecimal | The maximum cart cost for which this provider is available. |
| maxTotalWeightKgs | BigDecimal | The maximum total cart weight, in kilograms, for which this provider is available. |
| minCartCost | BigDecimal | The minimum cart cost for which this provider is available. |
| minTotalWeightKgs | BigDecimal | The minimum total cart weight, in kilograms, for which this provider is available. |
| title | String | The user-friendly display title for this shipping provider. |
Inherited from ShippingProvider
Properties
| Property | Returns | Description |
|---|---|---|
| managementPageTemplate | String | The 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.
| Parameter | Description |
|---|---|
productSku | the product SKU being shipped |
quantity | the quantity of the SKU being shipped |
shipFrom | the inventory location the item ships from |
calcCartFreight(Cart cart)
Returns: BigDecimal
Calculates the total freight cost for shipping everything in the given cart.
| Parameter | Description |
|---|---|
cart | the 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.
| Parameter | Description |
|---|---|
cart | the 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.