Default shipping provider implementation, calculating freight from a combination of a fixed per-cart cost, a fixed per-item cost, and per-item weight and volumetric multipliers. For each cart item, effective weight is the greater of its actual weight (scaled by weightMult) and its volumetric weight (scaled by volumetricMult), falling back to the product's flat freight cost when no weight or dimensions are set. Availability additionally honours the country and weight/cart-cost bounds configured on AbstractShippingProvider. Configured per store and serialised as XML under the "default" alias.
Group: E-commerce
Extends: AbstractShippingProvider
Properties
| Property | Returns | Description |
|---|---|---|
| detailedDescription | String | A formatted summary of the configured countries, weight limits, and this provider's cost and multiplier settings. |
| fixedCartCost | BigDecimal | The fixed cost added once per cart, on top of the per-item freight costs. |
| fixedPerItemCost | BigDecimal | The fixed cost added per cart item, on top of any weight or volumetric based cost. |
| managementPageTemplate | String | Path to the template used to render this provider's management page in the admin UI. |
| volumetricMult | BigDecimal | The multiplier applied to a product SKU's volumetric weight (height x width x length) to derive its freight cost. |
| weightMult | BigDecimal | The multiplier applied to a product SKU's actual weight in kilograms to derive its freight cost. |
Inherited from AbstractShippingProvider
Properties
| Property | Returns | Description |
|---|---|---|
| availableCountries | List<String> | The countries this provider ships to. |
| 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. |
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.
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.
Methods
getDetailedDescription() · getWeightMult() · getVolumetricMult() · getFixedPerItemCost() · getFixedCartCost() · calcCartFreight(Cart cart) · calcIndividualFreight(ProductSku productSku, BigDecimal quantity, InventoryLocation shipFrom) · isAvailable(Cart cart) · getManagementPageTemplate()
getDetailedDescription()
Returns: String
A formatted summary of the configured countries, weight limits, and this provider's cost and multiplier settings.
getWeightMult()
Returns: BigDecimal
The multiplier applied to a product SKU's actual weight in kilograms to derive its freight cost.
getVolumetricMult()
Returns: BigDecimal
The multiplier applied to a product SKU's volumetric weight (height x width x length) to derive its freight cost.
getFixedPerItemCost()
Returns: BigDecimal
The fixed cost added per cart item, on top of any weight or volumetric based cost.
getFixedCartCost()
Returns: BigDecimal
The fixed cost added once per cart, on top of the per-item freight costs.
calcCartFreight(Cart cart)
Returns: BigDecimal
Calculates the total freight cost for the cart, as the configured fixed cart cost plus the individual freight cost of each product order in the cart.
| Parameter | Description |
|---|---|
cart | the cart to calculate freight for |
calcIndividualFreight(ProductSku productSku, BigDecimal quantity, InventoryLocation shipFrom)
Returns: BigDecimal
Calculates the freight cost for a quantity of a single product SKU, from the configured fixed per-item cost plus a weight or volumetric based cost, or the product's flat freight cost when no weight or dimensions are configured.
| Parameter | Description |
|---|---|
productSku | the product SKU being shipped |
quantity | the quantity being shipped, treated as one if null |
shipFrom | the location the item ships from, currently not used by this provider |
isAvailable(Cart cart)
Returns: boolean
Whether this provider is available for the given cart, based on the cart's country, cost, and total effective weight against the bounds configured on this provider.
| Parameter | Description |
|---|---|
cart | the cart to check availability for |
getManagementPageTemplate()
Returns: String
Path to the template used to render this provider's management page in the admin UI.